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

chore(napi): allow value attribute on enum variants #2115

Merged
merged 1 commit into from
May 17, 2024

Conversation

lbarthon
Copy link
Contributor

This allows us to customize the enum value for string_enum. So far, only the case attribute was allowing us to customize the value of those variants, this is a next step in allowing the value to be different from the actual name.

This has a new test, and snapshots have been updated accordingly.

@Brooooooklyn - could we include that in napi v2 and tag after it?

This allows us to customize the enum value for string_enum. So far, only the
case attribute was allowing us to customize the value of those variants, this
is a next step in allowing the value to be different from the actual name.

This has a new test, and snapshots have been updated accordingly.
Copy link
Sponsor Member

could we include that in napi v2 and tag after it?

sure

@Brooooooklyn Brooooooklyn merged commit c223954 into napi-rs:main May 17, 2024
48 of 49 checks passed
southorange0929 pushed a commit to southorange0929/napi-rs that referenced this pull request May 17, 2024
This allows us to customize the enum value for string_enum. So far, only the case attribute was allowing us to customize the value of those variants, this is a next step in allowing the value to be different from the actual name.

This has a new test, and snapshots have been updated accordingly.

@Brooooooklyn - could we include that in napi v2 and tag after it?
Brooooooklyn pushed a commit that referenced this pull request May 18, 2024
This allows us to customize the enum value for string_enum. So far, only the case attribute was allowing us to customize the value of those variants, this is a next step in allowing the value to be different from the actual name.

This has a new test, and snapshots have been updated accordingly.

@Brooooooklyn - could we include that in napi v2 and tag after it?
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.

None yet

2 participants