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

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { curryN } from './curryN.js'import { map } from './map.js'import { max } from './max.js'import { reduce } from './reduce.js'
export function converge(fn, transformers){ if (arguments.length === 1) return _transformers => converge(fn, _transformers)
const highestArity = reduce( (a, b) => max(a, b.length), 0, transformers )
return curryN(highestArity, function (){ return fn.apply(this, map(g => g.apply(this, arguments), transformers)) })}
rambda

Version Info

Tagged at
2 months ago