slevithan / xregexp

Extended JavaScript regular expressions
http://xregexp.com/
MIT License
3.31k stars 278 forks source link

Incorrect return type of XRegExp in types/index.d.ts #327

Open mia1024 opened 3 years ago

mia1024 commented 3 years ago

Currently, the return type of XRegExp declared in types/index.d.ts is

declare function XRegExp(pattern: string, flags?: string): RegExp;

However, this annotation is incorrect because it does not capture the two custom properties <regexp>.xregexp.source and <regexp>.xregexp.flags as indicated in the API documentation.

I'm happy to open a PR to fix this issue if necessary.

slevithan commented 3 years ago

Thanks for the report, @jeriewang, and for offering to submit a PR to fix it! Would you mind opening a PR with the desired change?