Merge pull request #33379 from drewwyatt/ramda/adjust

[ramda] Change order of args for R.adjust
This commit is contained in:
Jesse Trinity
2019-02-26 13:19:32 -08:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -473,8 +473,8 @@ declare namespace R {
* Applies a function to the value at the given index of an array, returning a new copy of the array with the
* element at the given index replaced with the result of the function application.
*/
adjust<T>(fn: (a: T) => T, index: number, list: ReadonlyArray<T>): T[];
adjust<T>(fn: (a: T) => T, index: number): (list: ReadonlyArray<T>) => T[];
adjust<T>(index: number, fn: (a: T) => T, list: ReadonlyArray<T>): T[];
adjust<T>(index: number, fn: (a: T) => T): (list: ReadonlyArray<T>) => T[];
/**
* Returns true if all elements of the list match the predicate, false if there are any that don't.

View File

@@ -299,7 +299,7 @@ class F2 {
const capitalize = (str: string) => R.pipe(
R.split(""),
R.adjust(R.toUpper, 0),
R.adjust(0, R.toUpper),
R.join("")
)(str);