[ramda] curried R.take gains generic type (#37027)

This commit is contained in:
Cotton Hou
2019-07-22 12:28:25 -07:00
committed by Wesley Wigham
parent 385e78879b
commit 048f16f5ac
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -2816,9 +2816,9 @@ declare namespace R {
*/
take<T>(n: number, xs: ReadonlyArray<T>): T[];
take(n: number, xs: string): string;
take<T>(n: number): {
take(n: number): {
(xs: string): string;
(xs: ReadonlyArray<T>): T[];
<T>(xs: ReadonlyArray<T>): T[];
};
/**
+2
View File
@@ -1426,6 +1426,8 @@ type Pair = KeyValuePair<string, number>;
"Eugene Wright", "Gerry Mulligan", "Jack Six", "Alan Dawson", "Darius Brubeck", "Chris Brubeck",
"Dan Brubeck", "Bobby Militello", "Michael Moore", "Randy Jones"];
const takeFive = R.take(5);
// $ExpectType string[]
takeFive(members); // => ["Paul Desmond","Bob Bates","Joe Dodge","Ron Crotty","Lloyd Davis"]
};