Skip to main content

swappedOrFn()

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

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

Type Parameters

T

A

Parameters

a

(x) => A

The function to get the fallback return of.

Returns

Function

Type Parameters

B

Parameters

b

(y) => B

Returns

Function

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