deno.land / x / rambda@v9.1.1 / src / pipe.js

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { _arity } from './_internals/_arity.js'import { reduceFn } from './reduce.js'
export function _pipe(f, g){ return function (){ return g.call(this, f.apply(this, arguments)) }}
export function pipe(){ if (arguments.length === 0){ throw new Error('pipe requires at least one argument') }
return _arity(arguments[ 0 ].length, reduceFn( _pipe, arguments[ 0 ], Array.prototype.slice.call( arguments, 1, Infinity ) ))}
rambda

Version Info

Tagged at
2 months ago