You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
...which makes sense as default behaviour because typeof NaN === "number" in JavaScript, but it'd be useful to be able to use this library to do things like safely parse values in a querystring, coming from a redis cache, etc. etc.
So could it be another cli option or something?
The text was updated successfully, but these errors were encountered:
This is definitely a good idea. I'm currently thinking about utilizing typescript-json-schema, which would mean quite a number of changes to the project, but I will keep this in mind.
I'm still exploring different ways of checking types at runtime to improve performance (one being #13 after looking into #10), however, my time was limited. There is currently no remote branch.
How about an option to throw when
NaN
is assigned to a number type?Right now this library allows things like
const x: number = parseFloat("hello");
...which makes sense as default behaviour because
typeof NaN === "number"
in JavaScript, but it'd be useful to be able to use this library to do things like safely parse values in a querystring, coming from a redis cache, etc. etc.So could it be another cli option or something?
The text was updated successfully, but these errors were encountered: