_.take(n)
(and others) do not type check their arguments
#594
Labels
_.take(n)
(and others) do not type check their arguments
#594
Using highland@2, given this example:
the output will be:
As a developer using highland, I expect highland to throw an error if a false input parameter is provided. I might also expect it to infer the proper value from the faulty input (and at best issue a warning nontheless.)
I absolutely do not expect highland to just "ignore" the command and return all the items from the stream.
This may apply also to other function and the bug report may be generalized as:
Each highland function should validate its input throw errors if a false type is given, it may graciously try to infer the proper type, yet if that fails, and error should be thrown.
(I stumbled across this error from passing in an integer as a command line argument
./node my-script --limit 10
via commander, and I assumed the entire time I was injecting an integer. I even typehinted for an integer within my typescript codebase, yet as the typecheck only happens on compile time, I had a hard time figuring out the source of this issue until I started a remote debugger session.)The text was updated successfully, but these errors were encountered: