Re:V8n – Fluent validation library for JavaScript
by twiss on Sunday July 15, 2018 @03:39PM
(#17536675)
No, it doesn't mean that. You can try it out here: https://runkit.com/embed/ev53mh0z4nxt
`makeTestType("null")()(null)` return true, but `makeTestType("number")()(null)` doesn't. The signature of `makeTestType` is `type: String => () => value: Any => Boolean`.
I read the code, and I do not think this library is suitable for real-world use.
Consider `makeTestType` (https://github.com/imbrn/v8n/blob/master/src/v8n.js#L973-L98...):
This means that null and "null" (as a string) are now numbers. It also means that an array of numbers is a number... something that is counterintuitive for the user of the library.In addition to that, most of the time you want to deal with finite numbers. A validation library should have an API that reflects this, but this is not the case for v8n.