Skip to main content

swappedOrFn()

swappedOrFn<T, A>(a): <B>(b) => (c) => boolean

Swapped Logical (Function Result) Disjunction: (b(x) || a(x)).

Type Parameters

T

T

The type of the input value of the functions.

A

A

The return type of the first function.

Parameters

a

(x) => A

The function to get the fallback return of.

Returns

<B>(b): (c) => boolean

Type Parameters

B

B

Parameters

b

(y) => B

Returns

(c): boolean

Parameters

c

T

Returns

boolean

See

https://en.wikipedia.org/wiki/Logical_disjunction

Remarks

pure function

Example

swappedOrFn(s => s.trimEnd())(s => s.trim())('foo bar ');
// true