You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see you are already pulling in lodash.isregexp. What else is left except for exposing it in a regex predicate? Do you have any ideas on how to tackle predicates for the other two (i.e. emails and URLs)? Pull in another vetted library (such as validate.js) or would you rather roll your own?
I think this only needs the regex predicate, something like (regex) => (data) => regex.test(data), and some tests (happy case, error cases, cases without regexes and strings).
Regarding emails and URLs I'm a bit torn. I don't want to bloat js.spec because of these helpers, but I want to include them so it's more useful right out of the box. On the other hand including those things and then doing a sloppy job is not great, so I'd explore how we can use validator.js without adding too much kilobytes.
There should be built-in predicates for
The text was updated successfully, but these errors were encountered: