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

Params type conversion #4

Closed
georgyfarniev opened this issue Jul 26, 2019 · 3 comments
Closed

Params type conversion #4

georgyfarniev opened this issue Jul 26, 2019 · 3 comments

Comments

@georgyfarniev
Copy link
Contributor

If I supply @Params('id') id: number, then it should be converted to number. A good example can be found in type-graphql library.

@iyobo
Copy link
Owner

iyobo commented Jul 26, 2019 via email

@iyobo
Copy link
Owner

iyobo commented Jul 26, 2019

Besides strings(default) and numbers(requested), the other primitive is the boolean.

For numbers, An item can either be a number or NAN, so that's super easy to confidently cast.

For The boolean, however, it is more nuanced and open to interpretation of what a true or a false is depending on expected input. So I'm considering leaving boolean as is. Suggestions @georgyfarniev?

@iyobo
Copy link
Owner

iyobo commented Jul 26, 2019

Fixed in v1.3.6 for number primitives only.
Published to npm.

Feel free to open up another issue for other primitives with suggestions on how to cast them and we can discuss those there.

@iyobo iyobo closed this as completed Jul 26, 2019
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

No branches or pull requests

2 participants