mime icon indicating copy to clipboard operation
mime copied to clipboard

fix: make regexp more compatible

Open pmaoui opened this issue 7 years ago • 1 comments

I had an issue in a custom JS env (jest for testing) that apparently doesn't support "RegExp.$1"

As stated here : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/n

This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

So here is a more compatible version for the same functionality (ECMAScript 3): https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/String/match

Thank you for this module :)

pmaoui avatar Nov 16 '18 17:11 pmaoui

I agreed with your changes and rebase the PR.

pmaoui avatar Nov 17 '18 06:11 pmaoui

Sorry for taking so long to act on this. The code in question no longer uses a regex so I'm going to close this out.

broofa avatar Sep 19 '23 14:09 broofa