core-js-bundle 3.19.1 → 3.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # core-js-bundle
1
+ ![logo](https://user-images.githubusercontent.com/2213682/146607186-8e13ddef-26a4-4ebf-befd-5aac9d77c090.png)
2
2
 
3
3
  [![Open Collective](https://opencollective.com/core-js/all/badge.svg?label=open%20collective)](https://opencollective.com/core-js) [![version](https://img.shields.io/npm/v/core-js.svg)](https://www.npmjs.com/package/core-js) [![core-js downloads](https://img.shields.io/npm/dm/core-js.svg?label=npm%20i%20core-js)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![core-js-pure downloads](https://img.shields.io/npm/dm/core-js-pure.svg?label=npm%20i%20core-js-pure)](https://npm-stat.com/charts.html?package=core-js&package=core-js-pure&package=core-js-compat&from=2014-11-18) [![tests](https://github.com/zloirock/core-js/workflows/tests/badge.svg)](https://github.com/zloirock/core-js/actions) [![eslint](https://github.com/zloirock/core-js/workflows/eslint/badge.svg)](https://github.com/zloirock/core-js/actions)
4
4
 
@@ -22,37 +22,47 @@
22
22
 
23
23
  ---
24
24
 
25
- [*Example*](http://goo.gl/a2xexl):
25
+ [*Example of usage*](https://is.gd/XD4mRe):
26
26
  ```js
27
- import 'core-js'; // <- at the top of your entry point
27
+ import 'core-js/actual'; // <- at the top of your entry point
28
28
 
29
29
  Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
30
- [1, [2, 3], [4, [5]]].flat(2); // => [1, 2, 3, 4, 5]
31
- Promise.resolve(32).then(x => console.log(x)); // => 32
30
+ [1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
31
+ Promise.resolve(42).then(x => console.log(x)); // => 42
32
+ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
33
+ queueMicrotask(() => console.log('called as microtask'));
32
34
  ```
33
35
 
34
36
  *You can load only required features*:
35
37
  ```js
36
- import 'core-js/features/array/from'; // <- at the top of your entry point
37
- import 'core-js/features/array/flat'; // <- at the top of your entry point
38
- import 'core-js/features/set'; // <- at the top of your entry point
39
- import 'core-js/features/promise'; // <- at the top of your entry point
38
+ import 'core-js/actual/array/from'; // <- at the top of your entry point
39
+ import 'core-js/actual/array/group-by'; // <- at the top of your entry point
40
+ import 'core-js/actual/set'; // <- at the top of your entry point
41
+ import 'core-js/actual/promise'; // <- at the top of your entry point
42
+ import 'core-js/actual/structured-clone'; // <- at the top of your entry point
43
+ import 'core-js/actual/queue-microtask'; // <- at the top of your entry point
40
44
 
41
45
  Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
42
- [1, [2, 3], [4, [5]]].flat(2); // => [1, 2, 3, 4, 5]
43
- Promise.resolve(32).then(x => console.log(x)); // => 32
46
+ [1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
47
+ Promise.resolve(42).then(x => console.log(x)); // => 42
48
+ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
49
+ queueMicrotask(() => console.log('called as microtask'));
44
50
  ```
45
51
 
46
52
  *Or use it without global namespace pollution*:
47
53
  ```js
48
- import from from 'core-js-pure/features/array/from';
49
- import flat from 'core-js-pure/features/array/flat';
50
- import Set from 'core-js-pure/features/set';
51
- import Promise from 'core-js-pure/features/promise';
54
+ import from from 'core-js-pure/actual/array/from';
55
+ import groupBy from 'core-js-pure/actual/array/group-by';
56
+ import Set from 'core-js-pure/actual/set';
57
+ import Promise from 'core-js-pure/actual/promise';
58
+ import structuredClone from 'core-js-pure/actual/structured-clone';
59
+ import queueMicrotask from 'core-js-pure/actual/queue-microtask';
52
60
 
53
61
  from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3]
54
- flat([1, [2, 3], [4, [5]]], 2); // => [1, 2, 3, 4, 5]
55
- Promise.resolve(32).then(x => console.log(x)); // => 32
62
+ groupBy([1, 2, 3, 4, 5], it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] }
63
+ Promise.resolve(42).then(x => console.log(x)); // => 42
64
+ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
65
+ queueMicrotask(() => console.log('called as microtask'));
56
66
  ```
57
67
 
58
68
  **It's a bundled global version, for more info see [`core-js` documentation](https://github.com/zloirock/core-js/blob/master/README.md).**