Skip to content

Commit

Permalink
move Array grouping proposal to stage 3
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 14, 2021
1 parent 2536657 commit b4826af
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -12,7 +12,7 @@
- Added `Error.prototype.toString` polyfill with many different engines bugs fixes
- Added `Number.prototype.toExponential` method polyfill with many different fixes for the most engines
- [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping):
- Moved to the stage 2
- Moved to the stage 3
- Added `Array.prototype.groupByMap` method
- Removed `@@species` support
- Added [change `Array` by copy stage 2 proposal](https://github.com/tc39/proposal-change-array-by-copy):
Expand Down
42 changes: 21 additions & 21 deletions README.md
Expand Up @@ -1937,7 +1937,28 @@ core-js(-pure)/es|stable|features/typed-array/at
```js
core-js(-pure)/stage/3
```
##### [`Array` grouping](#https://github.com/tc39/proposal-array-grouping)[⬆](#index)
Modules [`esnext.array.group-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.group-by.js), [`esnext.array.group-by-map`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.group-by-map.js).
```js
class Array {
groupBy(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): { [key]: Array<mixed> };
groupByMap(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): Map<key, Array<mixed>>;
}
```
[*CommonJS entry points:*](#commonjs-api)
```
core-js/proposals/array-grouping
core-js(-pure)/features/array(/virtual)/group-by
core-js(-pure)/features/array(/virtual)/group-by-map
```
[*Examples*](t.ly/xEqc):
```js
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
const map = [1, 2, 3, 4, 5].groupByMap(it => it % 2);
map.get(1); // => [1, 3, 5]
map.get(0); // => [2, 4]
````
##### [Array find from last](https://github.com/tc39/proposal-array-find-from-last)[⬆](#index)
Modules [`esnext.array.find-last`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.find-last.js), [`esnext.array.find-last-index`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.find-last-index.js), [`esnext.typed-array.find-last`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.find-last.js) and [`esnext.typed-array.find-last-index`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.find-last-index.js).
```js
Expand Down Expand Up @@ -2438,27 +2459,6 @@ core-js/features/typed-array/filter-reject
```js
[1, 2, 3, 4, 5].filterReject(it => it % 2); // => [2, 4]
````
##### [`Array` grouping](#https://github.com/tc39/proposal-array-grouping)[⬆](#index)
Modules [`esnext.array.group-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.group-by.js), [`esnext.array.group-by-map`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.group-by-map.js).
```js
class Array {
groupBy(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): { [key]: Array<mixed> };
groupByMap(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): Map<key, Array<mixed>>;
}
```
[*CommonJS entry points:*](#commonjs-api)
```
core-js/proposals/array-grouping
core-js(-pure)/features/array(/virtual)/group-by
core-js(-pure)/features/array(/virtual)/group-by-map
```
[*Examples*](t.ly/xEqc):
```js
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
const map = [1, 2, 3, 4, 5].groupByMap(it => it % 2);
map.get(1); // => [1, 3, 5]
map.get(0); // => [2, 4]
````
##### [Array deduplication](https://github.com/tc39/proposal-array-unique)[⬆](#index)
Modules [`esnext.array.unique-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.array.unique-by.js) and [`esnext.typed-array.unique-by`](https://github.com/zloirock/core-js/blob/master/packages/core-js/modules/esnext.typed-array.unique-by.js)
```js
Expand Down
1 change: 0 additions & 1 deletion packages/core-js/stage/2.js
@@ -1,4 +1,3 @@
require('../proposals/array-grouping');
require('../proposals/array-is-template-object');
require('../proposals/change-array-by-copy');
require('../proposals/decorators');
Expand Down
1 change: 1 addition & 0 deletions packages/core-js/stage/3.js
@@ -1,4 +1,5 @@
require('../proposals/array-find-from-last');
require('../proposals/array-grouping');
var parent = require('./4');

module.exports = parent;

0 comments on commit b4826af

Please sign in to comment.