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
benjamingr opened this issue
Jan 23, 2021
· 5 comments
Labels
discussIssues opened for discussions and feedbacks.lib / srcIssues and PRs related to general changes in the lib or src directory.utilIssues and PRs related to the built-in util module.
One of the most "obvious" missing features in Node.js regular expressions that every other platform ships is the ability to "escape" them. That is:
varstr=prompt("Please enter a string");str=escape(str);constre=newRegExp(str,"g");// handles reg exp special tokens with the replacement.
There are multiple packages doing this subtly incorrectly on NPM - lodash, escape-regexp and a few others.
I've worked on a TC39 proposal to add this API to the language and it is being considered again - but if the language committee rejects the proposal - the next best place is the platform.
My current plan is:
Try to request that the the language committee add this missing feature. Jordan has helpfully volunteered to raise this in the January TC39 meeting and possibly champion the proposal.
If TC39 shuts it down - make a PR to add a utility function to Node.js as suggested on that issue.
In regards to other languages and platforms - it seems that some ship this sort of API as part of the language and some do so as part of the platform.
I am opening this issue here for discussion of the plan.
An alternative suggested by some whatwg members is trying to coordinate this sort of API with them.
The text was updated successfully, but these errors were encountered:
benjamingr
added
util
Issues and PRs related to the built-in util module.
lib / src
Issues and PRs related to general changes in the lib or src directory.
labels
Jan 23, 2021
discussIssues opened for discussions and feedbacks.lib / srcIssues and PRs related to general changes in the lib or src directory.utilIssues and PRs related to the built-in util module.
Hey,
One of the most "obvious" missing features in Node.js regular expressions that every other platform ships is the ability to "escape" them. That is:
There are multiple packages doing this subtly incorrectly on NPM -
lodash
,escape-regexp
and a few others.I've worked on a TC39 proposal to add this API to the language and it is being considered again - but if the language committee rejects the proposal - the next best place is the platform.
My current plan is:
In regards to other languages and platforms - it seems that some ship this sort of API as part of the language and some do so as part of the platform.
I am opening this issue here for discussion of the plan.
An alternative suggested by some whatwg members is trying to coordinate this sort of API with them.
The text was updated successfully, but these errors were encountered: