forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregexMatchAll-esnext.types
More file actions
43 lines (39 loc) · 1.35 KB
/
regexMatchAll-esnext.types
File metadata and controls
43 lines (39 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//// [tests/cases/compiler/regexMatchAll-esnext.ts] ////
=== regexMatchAll-esnext.ts ===
const matches = /\w/g[Symbol.matchAll]("matchAll");
>matches : RegExpStringIterator<RegExpExecArray>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>/\w/g[Symbol.matchAll]("matchAll") : RegExpStringIterator<RegExpExecArray>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>/\w/g[Symbol.matchAll] : (str: string) => RegExpStringIterator<RegExpExecArray>
> : ^ ^^ ^^^^^
>/\w/g : RegExp
> : ^^^^^^
>Symbol.matchAll : unique symbol
> : ^^^^^^^^^^^^^
>Symbol : SymbolConstructor
> : ^^^^^^^^^^^^^^^^^
>matchAll : unique symbol
> : ^^^^^^^^^^^^^
>"matchAll" : "matchAll"
> : ^^^^^^^^^^
const array = [...matches];
>array : RegExpExecArray[]
> : ^^^^^^^^^^^^^^^^^
>[...matches] : RegExpExecArray[]
> : ^^^^^^^^^^^^^^^^^
>...matches : RegExpExecArray
> : ^^^^^^^^^^^^^^^
>matches : RegExpStringIterator<RegExpExecArray>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
const { index, input } = array[0];
>index : number
> : ^^^^^^
>input : string
> : ^^^^^^
>array[0] : RegExpExecArray
> : ^^^^^^^^^^^^^^^
>array : RegExpExecArray[]
> : ^^^^^^^^^^^^^^^^^
>0 : 0
> : ^