Skip to content

Better types for auth.makeUserRecord #112

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rhodgkins
Copy link
Contributor

Description

Allowed partial typed UserRecord object to be specified for parameter of auth.makeUserRecord.

Code sample

N/A

@rhodgkins rhodgkins force-pushed the makeUserRecord-types branch from eb0d53f to 97d7c83 Compare August 9, 2021 08:45
@rhodgkins rhodgkins force-pushed the makeUserRecord-types branch from 97d7c83 to 5e746e3 Compare August 19, 2021 07:40
@rhodgkins
Copy link
Contributor Author

Can anyone review and, if happy, merge this in please?

@rhodgkins
Copy link
Contributor Author

Bump @inlined & @taeold

Copy link
Member

@inlined inlined left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused why we can't just say Partial<UserRecord>? Why do we need to specifically ensure that we omit toJSON? On one hand the code complete might be cleaner, but it requires more thought to understand the type definitions.

@rhodgkins
Copy link
Contributor Author

I can’t remember why I removed toJSON now :-/ I don’t think a simple Partial will be enough though as it needs to recurse down to the sub objects (like it does at the moment with metadata, etc.), otherwise they will need to be fully defined.

@inlined
Copy link
Member

inlined commented Oct 27, 2021

I wonder if we should define RecursivePartial as demonstrated here (maybe in index.ts) and then use that in UserRecord and others. What do you think about that?

@rhodgkins
Copy link
Contributor Author

Yeh that’s fine with me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Issues awaiting author feedback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants