import { IterableX } from '../../iterable/iterablex.js'; import { reduceRight } from '../../iterable/reduceright.js'; import { ReduceOptions } from '../../iterable/reduceoptions.js'; /** * @ignore */ export function reduceRightProto(this: IterableX, options: ReduceOptions): R; export function reduceRightProto( this: IterableX, accumulator: (accumulator: R, current: T, index: number) => R, seed?: R ): R; export function reduceRightProto( this: IterableX, optionsOrAccumulator: ReduceOptions | ((accumulator: R, current: T, index: number) => R), seed?: R ): R { return reduceRight( this, // eslint-disable-next-line no-nested-ternary typeof optionsOrAccumulator === 'function' ? arguments.length > 1 ? // prettier-ignore { 'callback': optionsOrAccumulator, 'seed': seed } : // prettier-ignore { 'callback': optionsOrAccumulator } : optionsOrAccumulator ); } IterableX.prototype.reduceRight = reduceRightProto; declare module '../../iterable/iterablex' { interface IterableX { reduceRight: typeof reduceRightProto; } }