From 4652ea01d7c086e565008564e089cef77851c097 Mon Sep 17 00:00:00 2001 From: swwind Date: Tue, 23 Jul 2019 03:32:11 +0800 Subject: [PATCH] [ramda] fix R.flatten (#37017) * fix flatten * fix tests * fool mistake on tests --- types/ramda/index.d.ts | 2 +- types/ramda/ramda-tests.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 78fcccd911..a0ad555609 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -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(x: ReadonlyArray | ReadonlyArray | ReadonlyArray>): T[]; + flatten(x: ReadonlyArray | ReadonlyArray> | ReadonlyArray): T[]; /** * Returns a new function much like the supplied one, except that the first two arguments' diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 9830398779..3e9ecd3c89 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -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] }; () => {