knip icon indicating copy to clipboard operation
knip copied to clipboard

Escape all regex special characters in identifiers (fix #595)

Open oBusk opened this issue 2 years ago • 0 comments

Rather than just escaping $, escape all regex special characters in any identifiers to make sure the RegExp that is created is valid.

Used the list of characters to escape from the regex-escaping proposal

https://github.com/tc39/proposal-regex-escaping/blob/66d654ea6561ea064045c7ecf2da6870c892c9be/polyfill.js#L4

oBusk avatar Apr 19 '24 10:04 oBusk