Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for String.{matchAll,replaceAll} with a well known symbol #61448

Open
segevfiner opened this issue Mar 19, 2025 · 0 comments · May be fixed by #61449
Open

Add types for String.{matchAll,replaceAll} with a well known symbol #61448

segevfiner opened this issue Mar 19, 2025 · 0 comments · May be fixed by #61449
Assignees
Labels
Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Milestone

Comments

@segevfiner
Copy link

⚙ Compilation target

es2022

⚙ Library

ES2023

Missing / Incorrect Definition

Definitions for String.{matchAll,replaceAll} with an object that implements [Symbol.matchAll]/[Symbol.replace], rather than a pure RegExp.

Sample Code

const someObjectThatImplementsTheSymbols = ...; // e.g. https://github.com/segevfiner/node-pcre2
"foo".matchAll(someObjectThatImplementsTheSymbols);
"foo".replaceAll(someObjectThatImplementsTheSymbols, "bar");

Documentation Link

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll

@RyanCavanaugh RyanCavanaugh added Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases labels Mar 20, 2025
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted You can do this Possible Improvement The current behavior isn't wrong, but it's possible to see that it might be better in some cases
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants