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

Not working with TypeScript #14

Closed pjotrsavitski closed 2 years ago

pjotrsavitski commented 2 years ago

Would it be possible to make this package TypeScript friendly? This seems to be one thing that url-regex module had.

niftylettuce commented 2 years ago

I think you could add this to DefinitelyTyped stuff? I don't use TS

pjotrsavitski commented 2 years ago

I did give it a go and it installed, then I found out that the fix in only applicable to the Node.js environment, which is not my case. My usage is within the browser with controlled data set, which makes this issue less severe.

pjotrsavitski commented 2 years ago

I've added a pull request with instructions for TypeScript usage. It would still be better to include the necessary files into the repository itself. I suppose that two .ts files from here would do the trick and allow installing just one package.