deno.land / x / rambda@v9.1.1 / src / ascend.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
export function createCompareFunction( a, b, winner, loser){ if (a === b) return 0
return a < b ? winner : loser}
export function ascend( getFunction, a, b){ if (arguments.length === 1){ return (_a, _b) => ascend( getFunction, _a, _b ) } const aValue = getFunction(a) const bValue = getFunction(b)
return createCompareFunction( aValue, bValue, -1, 1 )}
rambda

Version Info

Tagged at
2 months ago