Variable: pipe()
const
pipe: {<Value
>(value
):Value
; <A
,B
>(value
,fn
):B
; <A
,B
,C
>(value
,fn1
,fn2
):C
; <A
,B
,C
,D
>(value
,fn1
,fn2
,fn3
):D
; <A
,B
,C
,D
,E
>(value
,fn1
,fn2
,fn3
,fn4
):E
; <A
,B
,C
,D
,E
,F
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
):F
; <A
,B
,C
,D
,E
,F
,G
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
):G
; <A
,B
,C
,D
,E
,F
,G
,H
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
,fn7
):H
; <A
,B
,C
,D
,E
,F
,G
,H
,I
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
,fn7
,fn8
):I
; <A
,B
,C
,D
,E
,F
,G
,H
,I
,J
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
,fn7
,fn8
,fn9
):J
; }
Defined in: core.d.ts:83
Returns the result of piping value
through the given functions.
Call Signature
<
Value
>(value
):Value
Type Parameters
Value
Value
Parameters
value
Value
Returns
Value
Call Signature
<
A
,B
>(value
,fn
):B
Type Parameters
A
A
B
B
Parameters
value
A
fn
(a
) => B
Returns
B
Call Signature
<
A
,B
,C
>(value
,fn1
,fn2
):C
Type Parameters
A
A
B
B
C
C
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
Returns
C
Call Signature
<
A
,B
,C
,D
>(value
,fn1
,fn2
,fn3
):D
Type Parameters
A
A
B
B
C
C
D
D
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
Returns
D
Call Signature
<
A
,B
,C
,D
,E
>(value
,fn1
,fn2
,fn3
,fn4
):E
Type Parameters
A
A
B
B
C
C
D
D
E
E
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
Returns
E
Call Signature
<
A
,B
,C
,D
,E
,F
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
):F
Type Parameters
A
A
B
B
C
C
D
D
E
E
F
F
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
fn5
(e
) => F
Returns
F
Call Signature
<
A
,B
,C
,D
,E
,F
,G
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
):G
Type Parameters
A
A
B
B
C
C
D
D
E
E
F
F
G
G
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
fn5
(e
) => F
fn6
(f
) => G
Returns
G
Call Signature
<
A
,B
,C
,D
,E
,F
,G
,H
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
,fn7
):H
Type Parameters
A
A
B
B
C
C
D
D
E
E
F
F
G
G
H
H
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
fn5
(e
) => F
fn6
(f
) => G
fn7
(g
) => H
Returns
H
Call Signature
<
A
,B
,C
,D
,E
,F
,G
,H
,I
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
,fn7
,fn8
):I
Type Parameters
A
A
B
B
C
C
D
D
E
E
F
F
G
G
H
H
I
I
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
fn5
(e
) => F
fn6
(f
) => G
fn7
(g
) => H
fn8
(h
) => I
Returns
I
Call Signature
<
A
,B
,C
,D
,E
,F
,G
,H
,I
,J
>(value
,fn1
,fn2
,fn3
,fn4
,fn5
,fn6
,fn7
,fn8
,fn9
):J
Type Parameters
A
A
B
B
C
C
D
D
E
E
F
F
G
G
H
H
I
I
J
J
Parameters
value
A
fn1
(a
) => B
fn2
(b
) => C
fn3
(c
) => D
fn4
(d
) => E
fn5
(e
) => F
fn6
(f
) => G
fn7
(g
) => H
fn8
(h
) => I
fn9
(i
) => J
Returns
J
Example
import { map, pipe, reduce, toArray } from 'lfi'
console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
map(word => word.toUpperCase()),
reduce(toArray()),
// Also works with non-`lfi` functions!
array => array.sort(),
),
)
//=> [ 'SLOTH', 'LAZY', 'SLEEP' ]
Since
v0.0.1