microsoft / microsoft/TypeScript

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

Ouverte
#61,448 3 commentaires 0 réactions 1 personne assignée Réclamée par @rbuckton Voir sur GitHub
Domain: lib.d.ts Help Wanted Possible Improvement
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
2 j 4 h
PR mergées (30 j)
132

Description

### ⚙ 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

```TypeScript
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

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.