-
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
issue with enum transformation #116
Comments
I'm not sure to follow. |
Pardon my english, For example, with the plugin typescript enum PassPunchKind {
MAXIMUM_DAILY_PUNCHES,
MAXIMUM_MONTHLY_PUNCHES,
MAXIMUM_MONTHLY_PUNCHES_ON_FIRM,
MAXIMUM_MONTHLY_PUNCHES_ON_GYM
} will be transform to enum PassPunchKind {
MaximumDailyPunches = 'MAXIMUM_DAILY_PUNCHES',
MaximumMonthlyPunches = 'MAXIMUM_MONTHLY_PUNCHES',
MaximumMonthlyPunchesOnFirm = 'MAXIMUM_MONTHLY_PUNCHES_ON_FIRM',
MaximumMonthlyPunchesOnGym = 'MAXIMUM_MONTHLY_PUNCHES_ON_GYM'
} but with typescript-mock-data the same enum will be used as export const aPassPunchLimitation = (
overrides?: Partial<PassPunchLimitation>,
_relationshipsToOmit: Array<string> = [],
): PassPunchLimitation => {
const relationshipsToOmit = [..._relationshipsToOmit, 'PassPunchLimitation'];
return {
isReached:
overrides && overrides.hasOwnProperty('isReached')
? overrides.isReached!
: true,
kind:
overrides && overrides.hasOwnProperty('kind')
? overrides.kind!
: PassPunchKind.Maximum_Daily_Punches, // <<<<<------ HERE
nextAvailabilityDate:
overrides && overrides.hasOwnProperty('nextAvailabilityDate')
? overrides.nextAvailabilityDate!
: 'alias',
threshold:
overrides && overrides.hasOwnProperty('threshold')
? overrides.threshold!
: 6720,
};
}; which will cause error because |
I see, it seems like the PR you are mentionning fixes one issue but adds a new one. |
@Benoit-ROBIN The bug should be fixed now with PR #120 Can you confirm? |
@ardeois sorry for the response delay, it's all good, no errors. Thank you for your work 🙏 ❤️ |
Hi
I tried to have my enum generated in pascalCase (key and value), but in my case only the keys are transformed to pascalCase, the value stay in snakeCase.
I have seen this pr and I thought maybe it was overwritten accidentally ?
here my config
I have set transformUnderscore to false because I need to keep underscore on my type's name.
The text was updated successfully, but these errors were encountered: