You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My compilation target is esnext and my lib is the default.
Missing / Incorrect Definition
RegExpMatchArray extends string[], which can lead to unsound behavior.
I understand this can make string matching a little unwieldy, but it has already been unwieldy since regexps aren't generic (ref #32098, #42296), so I suggest we at least ensure correctness.
This fails at runtime, because when we have an alternation of capturing groups, all capturing groups will have their corresponding slot in the match array, but some values could be undefined.
Documentation Link
The text was updated successfully, but these errors were encountered:
Josh-Cena
changed the title
RegExpMatchArray should extend (string | undefined)[]RegExpMatchArray should extend [string, ...(string | undefined)[]]May 24, 2022
@MartinJohns May I know your point of objection? I understand you usually downvote issues that don't follow the template, but that's not the point here. So I guess it's about making string matching harder to work with?
lib Update Request
Configuration Check
My compilation target is
esnext
and my lib isthe default
.Missing / Incorrect Definition
RegExpMatchArray
extendsstring[]
, which can lead to unsound behavior.I understand this can make string matching a little unwieldy, but it has already been unwieldy since regexps aren't generic (ref #32098, #42296), so I suggest we at least ensure correctness.
Sample Code
Playground
This fails at runtime, because when we have an alternation of capturing groups, all capturing groups will have their corresponding slot in the match array, but some values could be
undefined
.Documentation Link
The text was updated successfully, but these errors were encountered: