both
Returns a predicate that checks if a value satisfies both predicates.
Binary AND combinator — shorthand for allPass([f, g]). When both inputs
are type guards, the result narrows to the intersection of their target types.
Usage
both<T>(f: (value: T) => boolean, g: (value: T) => boolean)
Returns a predicate that checks if a value satisfies both predicates.
Binary AND combinator — shorthand for allPass([f, g]). When both inputs
are type guards, the result narrows to the intersection 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 only when both predicates pass.