UNPKG

@ldrick/trade-indicators

Version:
16 lines (15 loc) 602 B
import { either as E, function as F, readonlyRecord as RR } from 'fp-ts/lib'; import * as arr from './array.js'; /** * Safely convert `RR.ReadonlyRecord<string, RNEA.ReadonlyNonEmptyArray<number>>>` * to `RR.ReadonlyRecord<string, RNEA.ReadonlyNonEmptyArray<Big>>>`. * * @internal */ export const toBig = ((obj) => F.pipe(obj, RR.traverse(E.Applicative)(arr.toBig))); /** * Validates if every Array in Record has the required size. * * @internal */ export const validateRequiredSize = ((required) => (record) => F.pipe(record, RR.traverse(E.Applicative)(arr.validateRequiredSize(required))));