-
Notifications
You must be signed in to change notification settings - Fork 768
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
Remove functions from enum values #2099
base: develop
Are you sure you want to change the base?
Conversation
Why not combine the filter operations to save an intermediate array creation? |
@Clashsoft In this case I would prefer code style in favor of performance, as honestly the performance gain would be quite minuscule, but if others would agree that this should be refactored I would also be open to do so |
In addition I would even argue that the parseInt should be guarded with typeof value === 'string' instead of !== function because that is the assumption of |
Hey @Clashsoft! Sorry for the long wait. I have addressed your requested changes, but now I'm not even sure whether the |
@SimonRosenau Thanks for addressing! I believe you don't need it anymore. See https://stackoverflow.com/a/43091709/4138801
Or with ES2017 according to this comment:
|
@Clashsoft Makes absolute sense! Adjusted 🙂 |
LGTM! |
Description
This change removes function declarations from enum values.
I am using an enum with an companion namespace with utility functions:
Within a request body as such:
The error returned by the server upon sending an invalid enum value is serialized as the following:
This PR removes the function declaration from the possible enum values in the error message
Checklist
Update index.md
)develop
)npm run prettier:check
passesnpm run lint:check
passesFixes