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

feat: oneof=unions-value to use the same field name for oneof cases #1062

Merged
merged 4 commits into from
Jun 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Narrow options in helpers to follow code style
  • Loading branch information
bhollis committed Jun 14, 2024
commit 04f7e00174ac39ef37b3a8c2b31b8e8c9dfa59b7
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export function maybeCheckIsNull(options: Pick<Options, "useNullAsOptional">, ty
return options.useNullAsOptional ? ` ${prefix} ${typeName} === null` : "";
}

export function oneofValueName(fieldName: string, options:Options) {
export function oneofValueName(fieldName: string, options: Pick<Options, "oneof">) {
return (options.oneof === OneofOption.UNIONS) ? fieldName : 'value';
}

Expand Down
Loading