-
Notifications
You must be signed in to change notification settings - Fork 59
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
Keep C# enum value sequence #79
Conversation
converter.js
Outdated
if (value == null) { | ||
rows.push(` ${key},`); | ||
} else { | ||
rows.push(` ${key} = ${value != null ? value : i},`); |
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.
value
is always != null
here, so this ternary expression can be removed
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.
Thats right! My mistake!
I did an ammend for previous commit.
No to my ears that sounds solid, go for it 👍 |
As I could test, TypeScript folow the same C# sequence numbering when enum value is missing in declaring type.
a17fa43
to
96f4f91
Compare
Sounds good to me! 👍 |
@digocesar could you add public enum TestEnum {
...
G // 27 in decimal
} Also, some suggestions to consider:
|
Done. |
Hey guys @svenheden @digocesar, I think it is a high time we publish a new NPM release. Also, what do you guys think about bumping up the major version - because we migrated to .NET 8 and we have a lot of other good improvements as well? |
I was thinking to suggest it too. |
Sounds good guys! I just bumped the version to 1.0.0 and published to npm. |
As I could test, TypeScript folow the same C# numbering sequence when enum value is missing in declaring type.
I think that if no number is defined in C#, it could remains not defined in TypeScript.
@svenheden and @SafeerH, any idea of problems we might have with this change?
C#: https://sharplab.io/#v2:CYLg1APgAgzABAUwHYFcC2cBCBLANr7JAcwGEBPAY1wQFgAoAb3rhYEEAaZlzOAXjgDsnOizglhogCJ84AFgksAovQC+QA==
TypeScript: https://www.typescriptlang.org/play/?#code/KYOwrgtgBAQglgGwXEBzAwgTwMYOAKAG98pSBBAGhNJigF4oB2K0qdF0gEXqgBYOoAUXwBfIA
Closes #29