UNPKG

rambdax

Version:

Extended version of Rambda - a lightweight, faster alternative to Ramda

18 lines (15 loc) 329 B
import { createCompareFunction } from './ascend.js' export function descend( getFunction, a, b ){ if (arguments.length === 1){ return (_a, _b) => descend( getFunction, _a, _b ) } const aValue = getFunction(a) const bValue = getFunction(b) return createCompareFunction( aValue, bValue, 1, -1 ) }