-
Notifications
You must be signed in to change notification settings - Fork 43
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
wip: Aa/snake default #3718
wip: Aa/snake default #3718
Conversation
Making room for a new thing called NameMapper.
Feel like maybe I'm going about this wrong.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
This is awesome!
@@ -56,12 +58,14 @@ export function createSchema< | |||
>['relationships']; | |||
}; | |||
} { | |||
const nameMapper = getNameMapper(options.nameMapping ?? 'snake'); |
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.
probably want the default to be 'none', so that we're not doing anything the user didn't ask for?
or do you think most users would expect us to map names to snake case? feels a bit magicky.
case 'none': | ||
return identity; | ||
default: | ||
return identity; |
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 think this can be:
default:
unreachable(nameMapping);
No description provided.