either
Returns a predicate that checks if a value satisfies either predicate.
Binary OR combinator — shorthand for anyPass([f, g]). When both inputs
are type guards, the result narrows to the union of their target types.
Usage
either<T>(f: (value: T) => boolean, g: (value: T) => boolean)
Returns a predicate that checks if a value satisfies either predicate.
Binary OR combinator — shorthand for anyPass([f, g]). When both inputs
are type guards, the result narrows to the union of their target types.
Parameters
f(value: T) => booleanrequired
the first predicate.
g(value: T) => booleanrequired
the second predicate.
Returns
a predicate that returns true when either predicate passes.