Skip to content

Commit b4826af

Browse files
committed
move Array grouping proposal to stage 3
babel/proposals#78 (comment)
1 parent 2536657 commit b4826af

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
- Added `Error.prototype.toString` polyfill with many different engines bugs fixes
1313
- Added `Number.prototype.toExponential` method polyfill with many different fixes for the most engines
1414
- [`Array` grouping proposal](https://github.com/tc39/proposal-array-grouping):
15-
- Moved to the stage 2
15+
- Moved to the stage 3
1616
- Added `Array.prototype.groupByMap` method
1717
- Removed `@@species` support
1818
- Added [change `Array` by copy stage 2 proposal](https://github.com/tc39/proposal-change-array-by-copy):

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1937,7 +1937,28 @@ core-js(-pure)/es|stable|features/typed-array/at
19371937
```js
19381938
core-js(-pure)/stage/3
19391939
```
1940+
##### [`Array` grouping](#https://github.com/tc39/proposal-array-grouping)[⬆](#index)
1941+
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).
1942+
```js
1943+
class Array {
1944+
groupBy(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): { [key]: Array<mixed> };
1945+
groupByMap(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): Map<key, Array<mixed>>;
1946+
}
1947+
```
1948+
[*CommonJS entry points:*](#commonjs-api)
1949+
```
1950+
core-js/proposals/array-grouping
1951+
core-js(-pure)/features/array(/virtual)/group-by
1952+
core-js(-pure)/features/array(/virtual)/group-by-map
1953+
```
1954+
[*Examples*](t.ly/xEqc):
1955+
```js
1956+
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
19401957
1958+
const map = [1, 2, 3, 4, 5].groupByMap(it => it % 2);
1959+
map.get(1); // => [1, 3, 5]
1960+
map.get(0); // => [2, 4]
1961+
````
19411962
##### [Array find from last](https://github.com/tc39/proposal-array-find-from-last)[⬆](#index)
19421963
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).
19431964
```js
@@ -2438,27 +2459,6 @@ core-js/features/typed-array/filter-reject
24382459
```js
24392460
[1, 2, 3, 4, 5].filterReject(it => it % 2); // => [2, 4]
24402461
````
2441-
##### [`Array` grouping](#https://github.com/tc39/proposal-array-grouping)[⬆](#index)
2442-
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).
2443-
```js
2444-
class Array {
2445-
groupBy(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): { [key]: Array<mixed> };
2446-
groupByMap(callbackfn: (value: any, index: number, target: any) => key, thisArg?: any): Map<key, Array<mixed>>;
2447-
}
2448-
```
2449-
[*CommonJS entry points:*](#commonjs-api)
2450-
```
2451-
core-js/proposals/array-grouping
2452-
core-js(-pure)/features/array(/virtual)/group-by
2453-
core-js(-pure)/features/array(/virtual)/group-by-map
2454-
```
2455-
[*Examples*](t.ly/xEqc):
2456-
```js
2457-
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
2458-
const map = [1, 2, 3, 4, 5].groupByMap(it => it % 2);
2459-
map.get(1); // => [1, 3, 5]
2460-
map.get(0); // => [2, 4]
2461-
````
24622462
##### [Array deduplication](https://github.com/tc39/proposal-array-unique)[⬆](#index)
24632463
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)
24642464
```js

packages/core-js/stage/2.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
require('../proposals/array-grouping');
21
require('../proposals/array-is-template-object');
32
require('../proposals/change-array-by-copy');
43
require('../proposals/decorators');

packages/core-js/stage/3.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require('../proposals/array-find-from-last');
2+
require('../proposals/array-grouping');
23
var parent = require('./4');
34

45
module.exports = parent;

0 commit comments

Comments
 (0)