microsoft / microsoft/TypeScript

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

Đang mở
#61,448 3 bình luận 0 reaction 1 người được giao Được @rbuckton nhận Xem trên GitHub
Domain: lib.d.ts Help Wanted Possible Improvement
Ngôn ngữ chính
Go
Star
111k
Fork
14.3k
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
132

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.