unless
Call Signature
Section titled “Call Signature”unless<
A,B,C>(predicate,onFalse): (value) =>B|C
Defined in: Composition/unless.ts:19
Executes a function on the piped value if a predicate is NOT met, otherwise returns the value unchanged.
Type Parameters
Section titled “Type Parameters”A
B
C
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value) => value is B
onFalse
Section titled “onFalse”(value) => C
Returns
Section titled “Returns”(value) => B | C
Example
Section titled “Example”when for executing when a predicate is met
Call Signature
Section titled “Call Signature”unless<
A,B>(predicate,onFalse): <V>(value) =>B|V
Defined in: Composition/unless.ts:23
Executes a function on the piped value if a predicate is NOT met, otherwise returns the value unchanged.
Type Parameters
Section titled “Type Parameters”A
B = A
Parameters
Section titled “Parameters”predicate
Section titled “predicate”(value) => boolean
onFalse
Section titled “onFalse”(value) => B
Returns
Section titled “Returns”<V>(value) => B | V
Example
Section titled “Example”when for executing when a predicate is met