Closed goranach closed 10 years ago
Sorry, I don't like that.
It would require changes to all code that acceps booleans to also accept "false" and "0" for consistency (then someone could also ask for accepting "123456" as numbers).
The state
argument has a JSDoc type annotation specifiying that is should be a boolean and I think it's the developer's job to ensure that a correct type is passed (right now it's partly my fault for not having any real documentation).
The only scenario (that I can think of) that would require this change, is that you're calling the library functions with input data coming directly from the user (i.e. query string or forms). In that case you should sanitize and validate the data anyway (ensuring that the state
parameter is converted to a correct type).
Thanks for the interest in the project anyway!
Ok.