Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c763fb0

Browse filesBrowse files
committed
Merge branch 'master' into nodeFactory-merge
# Conflicts: # src/compiler/factoryPublic.ts # src/services/codefixes/convertToAsyncFunction.ts # src/services/codefixes/helpers.ts # src/services/codefixes/inferFromUsage.ts # src/services/signatureHelp.ts # tests/baselines/reference/api/tsserverlibrary.d.ts # tests/baselines/reference/api/typescript.d.ts
2 parents 086633f + e4950b2 commit c763fb0
Copy full SHA for c763fb0

File tree

153 files changed

+18503
-6969
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner

153 files changed

+18503
-6969
lines changed

‎lib/cs/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/cs/diagnosticMessages.generated.json
+38-9Lines changed: 38 additions & 9 deletions
Large diffs are not rendered by default.

‎lib/de/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/de/diagnosticMessages.generated.json
+36-10Lines changed: 36 additions & 10 deletions
Large diffs are not rendered by default.

‎lib/es/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/es/diagnosticMessages.generated.json
+35-9Lines changed: 35 additions & 9 deletions
Large diffs are not rendered by default.

‎lib/fr/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/fr/diagnosticMessages.generated.json
+33-7Lines changed: 33 additions & 7 deletions
Large diffs are not rendered by default.

‎lib/it/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/it/diagnosticMessages.generated.json
+35-9Lines changed: 35 additions & 9 deletions
Large diffs are not rendered by default.

‎lib/ja/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/ja/diagnosticMessages.generated.json
+35-9Lines changed: 35 additions & 9 deletions
Large diffs are not rendered by default.

‎lib/ko/diagnosticMessages.generated.json

Copy file name to clipboardExpand all lines: lib/ko/diagnosticMessages.generated.json
+33-7Lines changed: 33 additions & 7 deletions
Large diffs are not rendered by default.

‎lib/lib.es2015.core.d.ts

Copy file name to clipboardExpand all lines: lib/lib.es2015.core.d.ts
+4-13Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,6 @@ interface Array<T> {
6262
* @param end If not specified, length of the this object is used as its default value.
6363
*/
6464
copyWithin(target: number, start: number, end?: number): this;
65-
66-
/**
67-
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
68-
* @param start The zero-based location in the array from which to start removing elements.
69-
* @param deleteCount The number of elements to remove. If deleteCount is omitted, or if its value is equal to or larger
70-
* than array.length - start (that is, if it is equal to or greater than the number of elements left in the array,
71-
* starting at start), then all the elements from start to the end of the array will be deleted.
72-
*/
73-
splice(start: number, deleteCount?: number): T[];
7465
}
7566

7667
interface ArrayConstructor {
@@ -233,27 +224,27 @@ interface NumberConstructor {
233224
* number. Only finite values of the type number, result in true.
234225
* @param number A numeric value.
235226
*/
236-
isFinite(number: number): boolean;
227+
isFinite(number: unknown): boolean;
237228

238229
/**
239230
* Returns true if the value passed is an integer, false otherwise.
240231
* @param number A numeric value.
241232
*/
242-
isInteger(number: number): boolean;
233+
isInteger(number: unknown): boolean;
243234

244235
/**
245236
* Returns a Boolean value that indicates whether a value is the reserved value NaN (not a
246237
* number). Unlike the global isNaN(), Number.isNaN() doesn't forcefully convert the parameter
247238
* to a number. Only values of the type number, that are also NaN, result in true.
248239
* @param number A numeric value.
249240
*/
250-
isNaN(number: number): boolean;
241+
isNaN(number: unknown): boolean;
251242

252243
/**
253244
* Returns true if the value passed is a safe integer.
254245
* @param number A numeric value.
255246
*/
256-
isSafeInteger(number: number): boolean;
247+
isSafeInteger(number: unknown): boolean;
257248

258249
/**
259250
* The value of the largest integer n such that n and n + 1 are both exactly representable as

‎lib/lib.es2015.d.ts

Copy file name to clipboardExpand all lines: lib/lib.es2015.d.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ and limitations under the License.
2121
/// <reference lib="es5" />
2222
/// <reference lib="es2015.core" />
2323
/// <reference lib="es2015.collection" />
24+
/// <reference lib="es2015.iterable" />
2425
/// <reference lib="es2015.generator" />
2526
/// <reference lib="es2015.promise" />
26-
/// <reference lib="es2015.iterable" />
2727
/// <reference lib="es2015.proxy" />
2828
/// <reference lib="es2015.reflect" />
2929
/// <reference lib="es2015.symbol" />

‎lib/lib.es2015.symbol.wellknown.d.ts

Copy file name to clipboardExpand all lines: lib/lib.es2015.symbol.wellknown.d.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ interface Int8Array {
274274
}
275275

276276
interface Uint8Array {
277-
readonly [Symbol.toStringTag]: "UInt8Array";
277+
readonly [Symbol.toStringTag]: "Uint8Array";
278278
}
279279

280280
interface Uint8ClampedArray {

‎lib/lib.es2018.d.ts

Copy file name to clipboardExpand all lines: lib/lib.es2018.d.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ and limitations under the License.
1919

2020

2121
/// <reference lib="es2017" />
22-
/// <reference lib="es2018.asyncgenerator" />
2322
/// <reference lib="es2018.asynciterable" />
23+
/// <reference lib="es2018.asyncgenerator" />
2424
/// <reference lib="es2018.promise" />
2525
/// <reference lib="es2018.regexp" />
2626
/// <reference lib="es2018.intl" />

‎lib/lib.es2019.array.d.ts

Copy file name to clipboardExpand all lines: lib/lib.es2019.array.d.ts
+16-154Lines changed: 16 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ and limitations under the License.
1818
/// <reference no-default-lib="true"/>
1919

2020

21+
type FlatArray<Arr, Depth extends number> = {
22+
"done": Arr,
23+
"recur": Arr extends ReadonlyArray<infer InnerArr>
24+
? FlatArray<InnerArr, [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20][Depth]>
25+
: Arr
26+
}[Depth extends -1 ? "done" : "recur"];
27+
2128
interface ReadonlyArray<T> {
2229

2330
/**
@@ -42,95 +49,11 @@ interface ReadonlyArray<T> {
4249
*
4350
* @param depth The maximum recursion depth
4451
*/
45-
flat<U>(this:
46-
ReadonlyArray<U[][][][]> |
47-
48-
ReadonlyArray<ReadonlyArray<U[][][]>> |
49-
ReadonlyArray<ReadonlyArray<U[][]>[]> |
50-
ReadonlyArray<ReadonlyArray<U[]>[][]> |
51-
ReadonlyArray<ReadonlyArray<U>[][][]> |
52-
53-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U[][]>>> |
54-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[][]>> |
55-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[][]> |
56-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>[]> |
57-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>[]> |
58-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>[]>> |
59-
60-
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>>> |
61-
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>>> |
62-
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[]>> |
63-
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>[]> |
64-
65-
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>>>,
66-
depth: 4): U[];
67-
68-
/**
69-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
70-
* specified depth.
71-
*
72-
* @param depth The maximum recursion depth
73-
*/
74-
flat<U>(this:
75-
ReadonlyArray<U[][][]> |
76-
77-
ReadonlyArray<ReadonlyArray<U>[][]> |
78-
ReadonlyArray<ReadonlyArray<U[]>[]> |
79-
ReadonlyArray<ReadonlyArray<U[][]>> |
80-
81-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U[]>>> |
82-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>[]>> |
83-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>[]> |
84-
85-
ReadonlyArray<ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>>,
86-
depth: 3): U[];
87-
88-
/**
89-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
90-
* specified depth.
91-
*
92-
* @param depth The maximum recursion depth
93-
*/
94-
flat<U>(this:
95-
ReadonlyArray<U[][]> |
96-
97-
ReadonlyArray<ReadonlyArray<U[]>> |
98-
ReadonlyArray<ReadonlyArray<U>[]> |
99-
100-
ReadonlyArray<ReadonlyArray<ReadonlyArray<U>>>,
101-
depth: 2): U[];
102-
103-
/**
104-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
105-
* specified depth.
106-
*
107-
* @param depth The maximum recursion depth
108-
*/
109-
flat<U>(this:
110-
ReadonlyArray<U[]> |
111-
ReadonlyArray<ReadonlyArray<U>>,
112-
depth?: 1
113-
): U[];
114-
115-
/**
116-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
117-
* specified depth.
118-
*
119-
* @param depth The maximum recursion depth
120-
*/
121-
flat<U>(this:
122-
ReadonlyArray<U>,
123-
depth: 0
124-
): U[];
125-
126-
/**
127-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
128-
* specified depth. If no depth is provided, flat method defaults to the depth of 1.
129-
*
130-
* @param depth The maximum recursion depth
131-
*/
132-
flat<U>(depth?: number): any[];
133-
}
52+
flat<A, D extends number = 1>(
53+
this: A,
54+
depth?: D
55+
): FlatArray<A, D>[]
56+
}
13457

13558
interface Array<T> {
13659

@@ -155,69 +78,8 @@ interface Array<T> {
15578
*
15679
* @param depth The maximum recursion depth
15780
*/
158-
flat<U>(this: U[][][][][][][][], depth: 7): U[];
159-
160-
/**
161-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
162-
* specified depth.
163-
*
164-
* @param depth The maximum recursion depth
165-
*/
166-
flat<U>(this: U[][][][][][][], depth: 6): U[];
167-
168-
/**
169-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
170-
* specified depth.
171-
*
172-
* @param depth The maximum recursion depth
173-
*/
174-
flat<U>(this: U[][][][][][], depth: 5): U[];
175-
176-
/**
177-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
178-
* specified depth.
179-
*
180-
* @param depth The maximum recursion depth
181-
*/
182-
flat<U>(this: U[][][][][], depth: 4): U[];
183-
184-
/**
185-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
186-
* specified depth.
187-
*
188-
* @param depth The maximum recursion depth
189-
*/
190-
flat<U>(this: U[][][][], depth: 3): U[];
191-
192-
/**
193-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
194-
* specified depth.
195-
*
196-
* @param depth The maximum recursion depth
197-
*/
198-
flat<U>(this: U[][][], depth: 2): U[];
199-
200-
/**
201-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
202-
* specified depth.
203-
*
204-
* @param depth The maximum recursion depth
205-
*/
206-
flat<U>(this: U[][], depth?: 1): U[];
207-
208-
/**
209-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
210-
* specified depth.
211-
*
212-
* @param depth The maximum recursion depth
213-
*/
214-
flat<U>(this: U[], depth: 0): U[];
215-
216-
/**
217-
* Returns a new array with all sub-array elements concatenated into it recursively up to the
218-
* specified depth. If no depth is provided, flat method defaults to the depth of 1.
219-
*
220-
* @param depth The maximum recursion depth
221-
*/
222-
flat<U>(depth?: number): any[];
81+
flat<A, D extends number = 1>(
82+
this: A,
83+
depth?: D
84+
): FlatArray<A, D>[]
22385
}

‎lib/lib.es5.d.ts

Copy file name to clipboardExpand all lines: lib/lib.es5.d.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,7 @@ interface Array<T> {
12741274
* @param start The zero-based location in the array from which to start removing elements.
12751275
* @param deleteCount The number of elements to remove.
12761276
*/
1277-
splice(start: number, deleteCount: number): T[];
1277+
splice(start: number, deleteCount?: number): T[];
12781278
/**
12791279
* Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
12801280
* @param start The zero-based location in the array from which to start removing elements.

‎lib/lib.esnext.string.d.ts

Copy file name to clipboardExpand all lines: lib/lib.esnext.string.d.ts
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,11 @@ interface String {
2525
* @param replaceValue A string containing the text to replace for every successful match of searchValue in this string.
2626
*/
2727
replaceAll(searchValue: string | RegExp, replaceValue: string): string;
28+
29+
/**
30+
* Replace all instances of a substring in a string, using a regular expression or search string.
31+
* @param searchValue A string to search for.
32+
* @param replacer A function that returns the replacement text.
33+
*/
34+
replaceAll(searchValue: string | RegExp, replacer: (substring: string, ...args: any[]) => string): string;
2835
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.