Closed codler closed 6 years ago
Isn't it expected behaviour that sending in an integer as a url param fails? Sending in 0 as a string instead should work, since Boolean(!'0') === true
.
@JCB-K I am not sure about expected behaviour or not but in the example posted above it makes sense to be able send in { score: 0 }
. Maybe the solution then is to make an explicit typeof var !== 'undefined'
. Then we will allow these falsy values as values for params:
false
null
undefined
0
NaN
''
""
Agree with @bstream , it would be strange to only accept strings in params
Yeah I suppose it's useful to do all typecasting within this repo, so you can send in whatever you want. Man, I wish we were using Flow or Typescript :)
@JCB-K TypeScript 👍
@codler nay, if we go into types, then Flow
This PR fix so you can send zero as a parameter