Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Sep 30, 2023
1 parent c9364ed commit bf093fd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog
##### Unreleased
- Re-introduced [`RegExp` escaping stage 2 proposal](https://github.com/tc39/proposal-regex-escaping), September 2023 TC39 meeting:
- Added `RegExp.escape` method with the new set of symbols for escaping
- Some years ago, it was presented in `core-js`, but it was removed after rejecting the old version of this proposal
- Added [`ArrayBuffer.prototype.{ transfer, transferToFixedLength }`](https://github.com/tc39/proposal-arraybuffer-transfer) and support transferring of `ArrayBuffer`s via [`structuredClone`](https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone) to engines with `MessageChannel`
- Optimized [`Math.f16round`](https://github.com/tc39/proposal-float16array) polyfill
- Fixed [some conversion cases](https://github.com/petamoriken/float16/issues/1046) of [`Math.f16round` and `DataView.prototype.{ getFloat16, setFloat16 }`](https://github.com/tc39/proposal-float16array)
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
- [`Map.prototype.emplace`](#mapprototypeemplace)
- [`Array.isTemplateObject`](#arrayistemplateobject)
- [`String.dedent`](#stringdedent)
- [`RegExp` escaping](#regexp-escaping)
- [`Symbol` predicates](#symbol-predicates)
- [Stage 1 proposals](#stage-1-proposals)
- [`Observable`](#observable)
Expand Down Expand Up @@ -2666,6 +2667,24 @@ String.dedent(console.log)`
print('${ message }')
`; // => ["print('", "')", raw: Array(2)], 42
```
##### [`RegExp` escaping](https://github.com/tc39/proposal-regex-escaping)[⬆](#index)
Module [`esnext.regexp.escape`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.regexp.escape.js)
```js
class RegExp {
static escape(value: string): string
}
```
[*CommonJS entry points:*](#commonjs-api)
```js
core-js/proposals/regexp-escaping
core-js(-pure)/full/regexp/escape
```
[*Example*](https://tinyurl.com/yqvehz5c):
```js
console.log(RegExp.escape('10$')); // => '\\x310\\$'
console.log(RegExp.escape('abcdefg_123456')); // => 'abcdefg_123456'
console.log(RegExp.escape('(){}[]|,.?*+-^$=<>\\/#&!%:;@~\'"`')); // => '\\(\\)\\{\\}\\[\\]\\|\\,\\.\\?\\*\\+\\-\\^\\$\\=\\<\\>\\\\\\/\\#\\&\\!\\%\\:\\;\\@\\~\\\'\\"\\`'
```
##### [`Symbol` predicates](https://github.com/tc39/proposal-symbol-predicates)[⬆](#index)
Modules [`esnext.symbol.is-registered-symbol`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.symbol.is-registered-symbol.js), [`esnext.symbol.is-well-known-symbol`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.symbol.is-well-known-symbol.js).
```js
Expand Down

0 comments on commit bf093fd

Please sign in to comment.