spamscanner / url-regex-safe

Regular expression matching for URL's. Maintained, safe, and browser-friendly version of url-regex. Resolves CVE-2020-7661 for Node.js servers.
https://forwardemail.net/docs/url-regex-javascript-node-js
MIT License
79 stars 16 forks source link

re2 breaks builds #18

Closed vicary closed 2 years ago

vicary commented 2 years ago

This originates from https://github.com/uhop/node-re2/issues/92, affecting builds via webpack and esbuild, browser or TypeScript for servers all alike.

Option 1

Change re2 into a peer dependency, such that users can choose to install re2 or not, depending on their situation.

Option 2

If the existence of url-regex-safe over url-regex means re2 must be kept in dependencies, at least change the actual code to allow fallback to plain RegExp, so webpack/esbuild users can mark re2 as external in build time until the issue above is fixed.

niftylettuce commented 2 years ago

v2.1.0 released which resolves this issue, thanks to @vicary for the PR

https://github.com/niftylettuce/url-regex-safe/releases/tag/v2.1.0

niftylettuce commented 2 years ago

See v3.0.0 https://github.com/spamscanner/url-regex-safe/releases/tag/v3.0.0