UNPKG

@ldrick/trade-indicators

Version:
28 lines (27 loc) 583 B
import { function as F, readonlyNonEmptyArray as RNEA } from 'fp-ts/lib'; export const ord = { /** * Big equals. * * @internal */ equals: (first, second) => first.eq(second), /** * Big compare. * * @internal */ compare: (first, second) => (first.lt(second) ? -1 : first.gt(second) ? 1 : 0), }; /** * Like `Math.max()` just for `Big`. * * @internal */ export const max = (values) => F.pipe(values, RNEA.max(ord)); /** * Chainable wrapper for Big.toNumber() * * @internal */ export const toNumber = (b) => b.toNumber();