[ramda] fix R.flatten (#37017)

* fix flatten

* fix tests

* fool mistake on tests
This commit is contained in:
swwind
2019-07-23 03:32:11 +08:00
committed by Wesley Wigham
parent 01caeca3d5
commit 4652ea01d7
2 changed files with 3 additions and 3 deletions

View File

@@ -1405,7 +1405,7 @@ declare namespace R {
* Returns a new list by pulling every item out of it (and all its sub-arrays) and putting
* them in a new array, depth-first.
*/
flatten<T>(x: ReadonlyArray<T> | ReadonlyArray<T[]> | ReadonlyArray<ReadonlyArray<T>>): T[];
flatten<T>(x: ReadonlyArray<T[]> | ReadonlyArray<ReadonlyArray<T>> | ReadonlyArray<T>): T[];
/**
* Returns a new function much like the supplied one, except that the first two arguments'

View File

@@ -925,8 +925,8 @@ interface Obj {
};
() => {
R.flatten([1, 2, [3, 4], 5, [6, [7, 8, [9, [10, 11], 12]]]]);
// => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
R.flatten([[1, 2], [3, 4], [5, 6]]); // => [1, 2, 3, 4, 5, 6]
R.flatten([1, 2, 3, 4, 5, 6]); // => [1, 2, 3, 4, 5, 6]
};
() => {