-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat: Handle custom generators for faker #101
feat: Handle custom generators for faker #101
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, thank you for your contribution!
I have 2 little comments before I would merge, if you could check them out.
Thanks!
src/index.ts
Outdated
return getCasualCustomScalarValue(customScalar, opts); | ||
} | ||
|
||
return getFakerCustomScalarValue(customScalar, opts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should probably check if the value is faker
and throw an error if the value is unknown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had one, but typescript told me the value couldn't be unknown. I'll add it back!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks for the udpates!
@Morphyish could you fix the lint so I can merge please |
@ardeois Done, linter should be good now. |
This PR allow users to add custom generators when using the faker library.
The syntax is similar to the current generators for casual.
Related open issue: #97