Skip to main content
Module

x/rambda/maxBy-spec.ts

Faster and smaller alternative to Ramda
Go to Latest
File
import {maxBy} from 'rambda'
const compareFn = (x: number) => x % 2 === 0 ? 1 : -1const first = 1const second = 2
describe('R.maxBy', () => { it('happy', () => { const result = maxBy(compareFn, first, second) result // $ExpectType 1 | 2 }) it('curried 1', () => { const result = maxBy(compareFn)(first, second) result // $ExpectType number }) it('curried 2', () => { const result = maxBy<number>(compareFn, first)(second) result // $ExpectType number }) it('curried 3', () => { const result = maxBy(compareFn)(first)(second) result // $ExpectType number })})