From 689d2b6ab55a5cb06f9ce61d7f7f8c23940392a9 Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Thu, 31 May 2018 13:04:24 -0400 Subject: [PATCH] Rename ESNext `flatten` to `flat` --- src/lib/esnext.array.d.ts | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/lib/esnext.array.d.ts b/src/lib/esnext.array.d.ts index ddba47bada..b602e8cc0e 100644 --- a/src/lib/esnext.array.d.ts +++ b/src/lib/esnext.array.d.ts @@ -3,7 +3,7 @@ interface ReadonlyArray { /** * Calls a defined callback function on each element of an array. Then, flattens the result into * a new array. - * This is identical to a map followed by a flatten of depth 1. + * This is identical to a map followed by flat with depth 1. * * @param callback A function that accepts up to three arguments. The flatMap method calls the * callback function one time for each element in the array. @@ -22,7 +22,7 @@ interface ReadonlyArray { * * @param depth The maximum recursion depth */ - flatten(this: + flat(this: ReadonlyArray | ReadonlyArray> | @@ -51,7 +51,7 @@ interface ReadonlyArray { * * @param depth The maximum recursion depth */ - flatten(this: + flat(this: ReadonlyArray | ReadonlyArray[][]> | @@ -71,7 +71,7 @@ interface ReadonlyArray { * * @param depth The maximum recursion depth */ - flatten(this: + flat(this: ReadonlyArray | ReadonlyArray> | @@ -86,7 +86,7 @@ interface ReadonlyArray { * * @param depth The maximum recursion depth */ - flatten(this: + flat(this: ReadonlyArray | ReadonlyArray>, depth?: 1 @@ -98,18 +98,18 @@ interface ReadonlyArray { * * @param depth The maximum recursion depth */ - flatten(this: + flat(this: ReadonlyArray, depth: 0 ): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. If no depth is provided, flatten method defaults to the depth of 1. + * specified depth. If no depth is provided, flat method defaults to the depth of 1. * * @param depth The maximum recursion depth */ - flatten(depth?: number): any[]; + flat(depth?: number): any[]; } interface Array { @@ -117,7 +117,7 @@ interface Array { /** * Calls a defined callback function on each element of an array. Then, flattens the result into * a new array. - * This is identical to a map followed by a flatten of depth 1. + * This is identical to a map followed by flat with depth 1. * * @param callback A function that accepts up to three arguments. The flatMap method calls the * callback function one time for each element in the array. @@ -135,7 +135,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][][][][][][][], depth: 7): U[]; + flat(this: U[][][][][][][][], depth: 7): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -143,7 +143,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][][][][][][], depth: 6): U[]; + flat(this: U[][][][][][][], depth: 6): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -151,7 +151,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][][][][][], depth: 5): U[]; + flat(this: U[][][][][][], depth: 5): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -159,7 +159,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][][][][], depth: 4): U[]; + flat(this: U[][][][][], depth: 4): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -167,7 +167,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][][][], depth: 3): U[]; + flat(this: U[][][][], depth: 3): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -175,7 +175,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][][], depth: 2): U[]; + flat(this: U[][][], depth: 2): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -183,7 +183,7 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[][], depth?: 1): U[]; + flat(this: U[][], depth?: 1): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the @@ -191,13 +191,13 @@ interface Array { * * @param depth The maximum recursion depth */ - flatten(this: U[], depth: 0): U[]; + flat(this: U[], depth: 0): U[]; /** * Returns a new array with all sub-array elements concatenated into it recursively up to the - * specified depth. If no depth is provided, flatten method defaults to the depth of 1. + * specified depth. If no depth is provided, flat method defaults to the depth of 1. * * @param depth The maximum recursion depth */ - flatten(depth?: number): any[]; + flat(depth?: number): any[]; }