mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
[ramda]: Correct order of reducing-fn params in reduceRight (#18798)
The reducing function in Ramda's reduceRight has signature (elem: T, acc: TResult) => TResult, as per https://github.com/ramda/ramda/blob/v0.24.0/src/reduceRight.js. The order of the parameters was switched at https://github.com/ramda/ramda/commit/68d1dc19fb035b0fcafcc1857331f9d00986470f
This commit is contained in:
committed by
Masahiro Wakame
parent
040a0eb7c5
commit
1066f6fb82
Vendored
+3
-3
@@ -1525,9 +1525,9 @@ declare namespace R {
|
||||
* function and passing it an accumulator value and the current value from the array, and
|
||||
* then passing the result to the next call.
|
||||
*/
|
||||
reduceRight<T, TResult>(fn: (acc: TResult, elem: T) => TResult, acc: TResult, list: T[]): TResult;
|
||||
reduceRight<T, TResult>(fn: (acc: TResult, elem: T) => TResult): (acc: TResult, list: T[]) => TResult;
|
||||
reduceRight<T, TResult>(fn: (acc: TResult, elem: T) => TResult, acc: TResult): (list: T[]) => TResult;
|
||||
reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult, acc: TResult, list: T[]): TResult;
|
||||
reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult): (acc: TResult, list: T[]) => TResult;
|
||||
reduceRight<T, TResult>(fn: (elem: T, acc: TResult) => TResult, acc: TResult): (list: T[]) => TResult;
|
||||
|
||||
/**
|
||||
* Similar to `filter`, except that it keeps only values for which the given predicate
|
||||
|
||||
@@ -328,7 +328,7 @@ R.times(i, 5);
|
||||
(() => {
|
||||
const pairs = [["a", 1], ["b", 2], ["c", 3]];
|
||||
|
||||
function flattenPairs(acc: [string, number], pair: [string, number]) {
|
||||
function flattenPairs(pair: [string, number], acc: Array<string|number>): Array<string|number> {
|
||||
return acc.concat(pair);
|
||||
}
|
||||
|
||||
@@ -911,7 +911,7 @@ type Pair = KeyValuePair<string, number>;
|
||||
() => {
|
||||
const pairs: Pair[] = [["a", 1], ["b", 2], ["c", 3]];
|
||||
|
||||
function flattenPairs(acc: Pair[], pair: Pair): Pair[] {
|
||||
function flattenPairs(pair: Pair, acc: Array<string|number>): Array<string|number> {
|
||||
return acc.concat(pair);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user