Skip to content

Commit 54e9953

Browse files
committed
Merge remote-tracking branch 'upstream/main' into lib-esnext-temporal
2 parents 0da9af1 + 8bb72d2 commit 54e9953

File tree

11 files changed

+335
-55
lines changed

11 files changed

+335
-55
lines changed

src/lib/es2015.collection.d.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
interface Map<K, V> {
2+
/**
3+
* Removes all elements from the Map.
4+
*/
25
clear(): void;
36
/**
47
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
@@ -73,7 +76,9 @@ interface Set<T> {
7376
* Appends a new element with a specified value to the end of the Set.
7477
*/
7578
add(value: T): this;
76-
79+
/**
80+
* Removes all elements from the Set.
81+
*/
7782
clear(): void;
7883
/**
7984
* Removes a specified value from the Set.

src/lib/es2020.symbol.wellknown.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ interface RegExp {
1919
* containing the results of that search.
2020
* @param string A string to search within.
2121
*/
22-
[Symbol.matchAll](str: string): RegExpStringIterator<RegExpMatchArray>;
22+
[Symbol.matchAll](str: string): RegExpStringIterator<RegExpExecArray>;
2323
}

src/lib/es2022.regexp.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface RegExpExecArray {
66
indices?: RegExpIndicesArray;
77
}
88

9-
interface RegExpIndicesArray extends Array<[number, number]> {
9+
interface RegExpIndicesArray extends Array<[number, number] | undefined> {
1010
groups?: {
1111
[key: string]: [number, number];
1212
};

src/lib/es2023.intl.d.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ declare namespace Intl {
99
negative: never;
1010
}
1111

12+
interface NumberFormatRangePartTypeRegistry extends NumberFormatPartTypeRegistry {
13+
approximatelySign: never;
14+
}
15+
16+
type NumberFormatRangePartTypes = keyof NumberFormatRangePartTypeRegistry;
17+
1218
interface NumberFormatOptions {
1319
roundingPriority?: "auto" | "morePrecision" | "lessPrecision" | undefined;
1420
roundingIncrement?: 1 | 2 | 5 | 10 | 20 | 25 | 50 | 100 | 200 | 250 | 500 | 1000 | 2000 | 2500 | 5000 | undefined;
@@ -23,7 +29,9 @@ declare namespace Intl {
2329
trailingZeroDisplay: "auto" | "stripIfInteger";
2430
}
2531

26-
interface NumberRangeFormatPart extends NumberFormatPart {
32+
interface NumberRangeFormatPart {
33+
type: NumberFormatRangePartTypes;
34+
value: string;
2735
source: "startRange" | "endRange" | "shared";
2836
}
2937

src/lib/esnext.intl.d.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,83 @@ declare namespace Intl {
99
formatRange(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): string;
1010
formatRangeToParts(startDate: FormattableTemporalObject | Date | number, endDate: FormattableTemporalObject | Date | number): DateTimeRangeFormatPart[];
1111
}
12+
13+
interface Locale {
14+
/**
15+
* Returns a list of one or more unique calendar identifiers for this locale.
16+
*
17+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCalendars)
18+
*/
19+
getCalendars(): string[];
20+
/**
21+
* Returns a list of one or more collation types for this locale.
22+
*
23+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getCollations)
24+
*/
25+
getCollations(): string[];
26+
/**
27+
* Returns a list of one or more unique hour cycle identifiers for this locale.
28+
*
29+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getHourCycles)
30+
*/
31+
getHourCycles(): string[];
32+
/**
33+
* Returns a list of one or more unique numbering system identifiers for this locale.
34+
*
35+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getNumberingSystems)
36+
*/
37+
getNumberingSystems(): string[];
38+
/**
39+
* Returns the ordering of characters indicated by either ltr (left-to-right) or by rtl (right-to-left) for this locale.
40+
*
41+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo)
42+
*/
43+
getTextInfo(): TextInfo;
44+
/**
45+
* Returns a list of supported time zones for this locale.
46+
*
47+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTimeZones)
48+
*/
49+
getTimeZones(): string[] | undefined;
50+
/**
51+
* Returns a `WeekInfo` object with the properties `firstDay`, `weekend` and `minimalDays` for this locale.
52+
*
53+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo)
54+
*/
55+
getWeekInfo(): WeekInfo;
56+
}
57+
58+
/**
59+
* An object representing text typesetting information associated with the Locale data specified in UTS 35's Layouts Elements.
60+
*
61+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo#return_value)
62+
*/
63+
interface TextInfo {
64+
/**
65+
* A string indicating the direction of text for the locale. Can be either "ltr" (left-to-right) or "rtl" (right-to-left).
66+
*
67+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo#direction)
68+
*/
69+
direction?: "ltr" | "rtl";
70+
}
71+
72+
/**
73+
* An object representing week information associated with the Locale data specified in UTS 35's Week Elements.
74+
*
75+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#return_value)
76+
*/
77+
interface WeekInfo {
78+
/**
79+
* An integer between 1 (Monday) and 7 (Sunday) indicating the first day of the week for the locale. Commonly 1, 5, 6, or 7.
80+
*
81+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#firstday)
82+
*/
83+
firstDay: number;
84+
/**
85+
* An array of integers between 1 and 7 indicating the weekend days for the locale.
86+
*
87+
* [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getWeekInfo#weekend)
88+
*/
89+
weekend: number[];
90+
}
1291
}

tests/baselines/reference/intlNumberFormatES2023.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8');
3131
new Intl.NumberFormat('en-GB').format('Infinity');
3232
new Intl.NumberFormat('en-GB').format('-Infinity');
3333
new Intl.NumberFormat('en-GB').format('+Infinity');
34+
35+
// Test approximatelySign part type
36+
const nf = new Intl.NumberFormat("en-US", {
37+
style: "currency",
38+
currency: "EUR",
39+
maximumFractionDigits: 0,
40+
});
41+
42+
const filtered = nf
43+
.formatRangeToParts(100, 100)
44+
.filter((part) => part.type !== "approximatelySign")
45+
.map((part) => part.value)
46+
.join("");
3447

3548

3649
//// [intlNumberFormatES2023.js]
@@ -59,3 +72,14 @@ new Intl.NumberFormat('en-GB').formatRangeToParts('123E-4', '567E8');
5972
new Intl.NumberFormat('en-GB').format('Infinity');
6073
new Intl.NumberFormat('en-GB').format('-Infinity');
6174
new Intl.NumberFormat('en-GB').format('+Infinity');
75+
// Test approximatelySign part type
76+
const nf = new Intl.NumberFormat("en-US", {
77+
style: "currency",
78+
currency: "EUR",
79+
maximumFractionDigits: 0,
80+
});
81+
const filtered = nf
82+
.formatRangeToParts(100, 100)
83+
.filter((part) => part.type !== "approximatelySign")
84+
.map((part) => part.value)
85+
.join("");

tests/baselines/reference/intlNumberFormatES2023.symbols

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,49 @@ new Intl.NumberFormat('en-GB').format('+Infinity');
130130
>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --))
131131
>format : Symbol(Intl.NumberFormat.format, Decl(lib.es5.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --))
132132

133+
// Test approximatelySign part type
134+
const nf = new Intl.NumberFormat("en-US", {
135+
>nf : Symbol(nf, Decl(intlNumberFormatES2023.ts, 32, 5))
136+
>Intl.NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --))
137+
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2016.intl.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --) ... and 5 more)
138+
>NumberFormat : Symbol(Intl.NumberFormat, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --), Decl(lib.es2023.intl.d.ts, --, --))
139+
140+
style: "currency",
141+
>style : Symbol(style, Decl(intlNumberFormatES2023.ts, 32, 43))
142+
143+
currency: "EUR",
144+
>currency : Symbol(currency, Decl(intlNumberFormatES2023.ts, 33, 20))
145+
146+
maximumFractionDigits: 0,
147+
>maximumFractionDigits : Symbol(maximumFractionDigits, Decl(intlNumberFormatES2023.ts, 34, 18))
148+
149+
});
150+
151+
const filtered = nf
152+
>filtered : Symbol(filtered, Decl(intlNumberFormatES2023.ts, 38, 5))
153+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --))
154+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
155+
>nf .formatRangeToParts(100, 100) .filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
156+
>nf .formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --))
157+
>nf : Symbol(nf, Decl(intlNumberFormatES2023.ts, 32, 5))
158+
159+
.formatRangeToParts(100, 100)
160+
>formatRangeToParts : Symbol(Intl.NumberFormat.formatRangeToParts, Decl(lib.es2023.intl.d.ts, --, --))
161+
162+
.filter((part) => part.type !== "approximatelySign")
163+
>filter : Symbol(Array.filter, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --))
164+
>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 40, 11))
165+
>part.type : Symbol(Intl.NumberRangeFormatPart.type, Decl(lib.es2023.intl.d.ts, --, --))
166+
>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 40, 11))
167+
>type : Symbol(Intl.NumberRangeFormatPart.type, Decl(lib.es2023.intl.d.ts, --, --))
168+
169+
.map((part) => part.value)
170+
>map : Symbol(Array.map, Decl(lib.es5.d.ts, --, --))
171+
>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 41, 8))
172+
>part.value : Symbol(Intl.NumberRangeFormatPart.value, Decl(lib.es2023.intl.d.ts, --, --))
173+
>part : Symbol(part, Decl(intlNumberFormatES2023.ts, 41, 8))
174+
>value : Symbol(Intl.NumberRangeFormatPart.value, Decl(lib.es2023.intl.d.ts, --, --))
175+
176+
.join("");
177+
>join : Symbol(Array.join, Decl(lib.es5.d.ts, --, --))
178+

tests/baselines/reference/intlNumberFormatES2023.types

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,108 @@ new Intl.NumberFormat('en-GB').format('+Infinity');
376376
>'+Infinity' : "+Infinity"
377377
> : ^^^^^^^^^^^
378378

379+
// Test approximatelySign part type
380+
const nf = new Intl.NumberFormat("en-US", {
381+
>nf : Intl.NumberFormat
382+
> : ^^^^^^^^^^^^^^^^^
383+
>new Intl.NumberFormat("en-US", { style: "currency", currency: "EUR", maximumFractionDigits: 0,}) : Intl.NumberFormat
384+
> : ^^^^^^^^^^^^^^^^^
385+
>Intl.NumberFormat : Intl.NumberFormatConstructor
386+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
387+
>Intl : typeof Intl
388+
> : ^^^^^^^^^^^
389+
>NumberFormat : Intl.NumberFormatConstructor
390+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
391+
>"en-US" : "en-US"
392+
> : ^^^^^^^
393+
>{ style: "currency", currency: "EUR", maximumFractionDigits: 0,} : { style: "currency"; currency: string; maximumFractionDigits: number; }
394+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
395+
396+
style: "currency",
397+
>style : "currency"
398+
> : ^^^^^^^^^^
399+
>"currency" : "currency"
400+
> : ^^^^^^^^^^
401+
402+
currency: "EUR",
403+
>currency : string
404+
> : ^^^^^^
405+
>"EUR" : "EUR"
406+
> : ^^^^^
407+
408+
maximumFractionDigits: 0,
409+
>maximumFractionDigits : number
410+
> : ^^^^^^
411+
>0 : 0
412+
> : ^
413+
414+
});
415+
416+
const filtered = nf
417+
>filtered : string
418+
> : ^^^^^^
419+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join("") : string
420+
> : ^^^^^^
421+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) .join : (separator?: string) => string
422+
> : ^ ^^^ ^^^^^
423+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map((part) => part.value) : string[]
424+
> : ^^^^^^^^
425+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") .map : <U>(callbackfn: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => U, thisArg?: any) => U[]
426+
> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^
427+
>nf .formatRangeToParts(100, 100) .filter((part) => part.type !== "approximatelySign") : Intl.NumberRangeFormatPart[]
428+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
429+
>nf .formatRangeToParts(100, 100) .filter : { <S extends Intl.NumberRangeFormatPart>(predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => value is S, thisArg?: any): S[]; (predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => unknown, thisArg?: any): Intl.NumberRangeFormatPart[]; }
430+
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
431+
>nf .formatRangeToParts(100, 100) : Intl.NumberRangeFormatPart[]
432+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
433+
>nf .formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[]
434+
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
435+
>nf : Intl.NumberFormat
436+
> : ^^^^^^^^^^^^^^^^^
437+
438+
.formatRangeToParts(100, 100)
439+
>formatRangeToParts : (start: number | bigint | Intl.StringNumericLiteral, end: number | bigint | Intl.StringNumericLiteral) => Intl.NumberRangeFormatPart[]
440+
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
441+
>100 : 100
442+
> : ^^^
443+
>100 : 100
444+
> : ^^^
445+
446+
.filter((part) => part.type !== "approximatelySign")
447+
>filter : { <S extends Intl.NumberRangeFormatPart>(predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => value is S, thisArg?: any): S[]; (predicate: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => unknown, thisArg?: any): Intl.NumberRangeFormatPart[]; }
448+
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
449+
>(part) => part.type !== "approximatelySign" : (part: Intl.NumberRangeFormatPart) => boolean
450+
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
451+
>part : Intl.NumberRangeFormatPart
452+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
453+
>part.type !== "approximatelySign" : boolean
454+
> : ^^^^^^^
455+
>part.type : keyof Intl.NumberFormatRangePartTypeRegistry
456+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
457+
>part : Intl.NumberRangeFormatPart
458+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
459+
>type : keyof Intl.NumberFormatRangePartTypeRegistry
460+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
461+
>"approximatelySign" : "approximatelySign"
462+
> : ^^^^^^^^^^^^^^^^^^^
463+
464+
.map((part) => part.value)
465+
>map : <U>(callbackfn: (value: Intl.NumberRangeFormatPart, index: number, array: Intl.NumberRangeFormatPart[]) => U, thisArg?: any) => U[]
466+
> : ^ ^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^^^^
467+
>(part) => part.value : (part: Intl.NumberRangeFormatPart) => string
468+
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
469+
>part : Intl.NumberRangeFormatPart
470+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
471+
>part.value : string
472+
> : ^^^^^^
473+
>part : Intl.NumberRangeFormatPart
474+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^
475+
>value : string
476+
> : ^^^^^^
477+
478+
.join("");
479+
>join : (separator?: string) => string
480+
> : ^ ^^^ ^^^^^
481+
>"" : ""
482+
> : ^^
483+

tests/baselines/reference/regexMatchAll-esnext.types

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
=== regexMatchAll-esnext.ts ===
44
const matches = /\w/g[Symbol.matchAll]("matchAll");
5-
>matches : RegExpStringIterator<RegExpMatchArray>
6-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7-
>/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator<RegExpMatchArray>
8-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9-
>/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator<RegExpMatchArray>
10-
> : ^ ^^ ^^^^^
5+
>matches : RegExpStringIterator<RegExpExecArray>
6+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7+
>/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator<RegExpExecArray>
8+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
9+
>/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator<RegExpExecArray>
10+
> : ^ ^^ ^^^^^
1111
>/\w/g : RegExp
1212
> : ^^^^^^
1313
>Symbol.matchAll : unique symbol
@@ -20,24 +20,24 @@ const matches = /\w/g[Symbol.matchAll]("matchAll");
2020
> : ^^^^^^^^^^
2121

2222
const array = [...matches];
23-
>array : RegExpMatchArray[]
24-
> : ^^^^^^^^^^^^^^^^^^
25-
>[...matches] : RegExpMatchArray[]
26-
> : ^^^^^^^^^^^^^^^^^^
27-
>...matches : RegExpMatchArray
28-
> : ^^^^^^^^^^^^^^^^
29-
>matches : RegExpStringIterator<RegExpMatchArray>
30-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23+
>array : RegExpExecArray[]
24+
> : ^^^^^^^^^^^^^^^^^
25+
>[...matches] : RegExpExecArray[]
26+
> : ^^^^^^^^^^^^^^^^^
27+
>...matches : RegExpExecArray
28+
> : ^^^^^^^^^^^^^^^
29+
>matches : RegExpStringIterator<RegExpExecArray>
30+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3131

3232
const { index, input } = array[0];
33-
>index : number | undefined
34-
> : ^^^^^^^^^^^^^^^^^^
35-
>input : string | undefined
36-
> : ^^^^^^^^^^^^^^^^^^
37-
>array[0] : RegExpMatchArray
38-
> : ^^^^^^^^^^^^^^^^
39-
>array : RegExpMatchArray[]
40-
> : ^^^^^^^^^^^^^^^^^^
33+
>index : number
34+
> : ^^^^^^
35+
>input : string
36+
> : ^^^^^^
37+
>array[0] : RegExpExecArray
38+
> : ^^^^^^^^^^^^^^^
39+
>array : RegExpExecArray[]
40+
> : ^^^^^^^^^^^^^^^^^
4141
>0 : 0
4242
> : ^
4343

0 commit comments

Comments
 (0)