Creates a Predicate for Strings.
Match against an array of allowed values
const isAorB = stringPredicate(['a', 'b']);const matches = isAorB('b');console.log(matches); // true
Match against a RegExp
const startsWithA = stringPredicate(/a.+/);const matches = startsWithA('ab');console.log(matches); // true
the Predicate
Generated using TypeDoc
Creates a Predicate for Strings.
Example
Match against an array of allowed values
Example
Match against a RegExp
Returns
the Predicate