Skip to content

Commit b511737

Browse files
committed
Merge branch 'main' into alpha
2 parents 493e8d6 + cf6675b commit b511737

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,19 @@ export function foldRightFn<T, U>(
332332
return array => (nativeReduceRight as (...args: any[]) => any).call(array, f, initial);
333333
}
334334

335+
export function foldRight1<T>(
336+
array: ArrayLike<T>,
337+
f: (accumulator: T, element: T, index: number) => T
338+
): T {
339+
return (nativeReduceRight as (...args: any[]) => any).call(array, f);
340+
}
341+
342+
export function foldRight1Fn<T>(
343+
f: (accumulator: T, element: T, index: number) => T
344+
): (array: ArrayLike<T>) => T {
345+
return array => foldRight1(array, f);
346+
}
347+
335348
export function foldMap<T, U>(
336349
array: ArrayLike<T>,
337350
f: (accumulator: U, element: U, index: number) => U,

0 commit comments

Comments
 (0)