tslab icon indicating copy to clipboard operation
tslab copied to clipboard

matchAll function is not found for a string.

Open zhangzhhz opened this issue 5 years ago • 1 comments

'bar bar sheep'.matchAll(/(bar)/g)

The above will give error: 1:17 - Property 'matchAll' does not exist on type '"bar bar sheep"'.

In Node, it gives expected output:

> 'bar bar sheep'.matchAll(/(bar)/g)
Object [RegExp String Iterator] {}

zhangzhhz avatar Apr 09 '20 11:04 zhangzhhz

I have the same issue with array properties. image

Makki93 avatar May 06 '22 07:05 Makki93

Now "@types/node": "^18.16.2" is specified in package.json and matchAll works in my environment with the latest version. Let me know if it's not fixed with the latest release.

yunabe avatar May 25 '23 14:05 yunabe