Skip to content
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

Closed
wants to merge 3 commits into from
Closed

wip: Aa/snake default #3718

wants to merge 3 commits into from

Conversation

aboodman
Copy link
Contributor

@aboodman aboodman commented Feb 6, 2025

No description provided.

Making room for a new thing called NameMapper.
Feel like maybe I'm going about this wrong.
@aboodman aboodman requested a review from darkgnotic February 6, 2025 03:56
Copy link

vercel bot commented Feb 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
replicache-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 3:57am
zbugs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 6, 2025 3:57am

Copy link
Contributor

@darkgnotic darkgnotic left a 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');
Copy link
Contributor

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;
Copy link
Contributor

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);

@aboodman aboodman closed this Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants