2 ms·
Can someone explain to me why I would need something like this over just hand rolling my own validation? Almost every time I've seen one of these JS validation
by euclideansphere 2y ago
Can someone explain to me why I would need something like this over just hand rolling my own validation? Almost every time I've seen one of these JS validation libraries used, it was to verify a form with < 10 inputs and every one of those validations were no more complex than `isNonEmptyString = (x: string | undefined) => x != null && x.trim() != "")` or `isGtZero = (x: any): !isNaN(parseInt(x, 10)) && parseInt(x, 10) > 0`
This feels about as trivial as an aggregate package of `isOdd` / `isArray` absurd micropackages. Surely I must be missing something because they're incredibly popular?
- _betty_ 2y agofor me i can auto-gen basic validation from either my typescript or graphql type. Then fairly easily extend it manually. yeah i could do it manually, but the integration with other tools was the killer.