Closed rapodaca closed 6 years ago
Passing a string to a method that accepts an object is not desired. The best we can do is throw a hard exception that an object is required.
Closing since no response from the issue reporter and not actionable as well
When a string is passed as the first argument to
validate
, the promise resolves instead of being rejected. This contrasts with the behavior when an object is passed, which is to be rejected.This non-intuitive behavior makes it possible for some hard-to-track bugs to creep into code using the library. Is there a good reason to for this dual behavior to be present?
Package version
5.0.5
Node.js and npm version
8.8.1
Sample Code (to reproduce the issue)
I expect the above to be rejected like the following: