core-js-pure 3.45.0 → 3.45.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 +8 -8
- package/internals/shared-store.js +2 -2
- package/modules/esnext.map.get-or-insert-computed.js +2 -1
- package/modules/esnext.map.get-or-insert.js +2 -1
- package/modules/esnext.weak-map.get-or-insert-computed.js +2 -1
- package/modules/esnext.weak-map.get-or-insert.js +2 -1
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
**I highly recommend reading this: [So, what's next?](https://github.com/zloirock/core-js/blob/master/docs/2023-02-14-so-whats-next.md)**
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
-
> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to
|
|
12
|
+
> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2025](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.
|
|
13
13
|
|
|
14
14
|
## Raising funds
|
|
15
15
|
|
|
@@ -25,17 +25,17 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
[*Example of usage*](https://tinyurl.com/
|
|
28
|
+
[*Example of usage*](https://tinyurl.com/28zqjbun):
|
|
29
29
|
```js
|
|
30
30
|
import 'core-js/actual';
|
|
31
31
|
|
|
32
|
-
Promise.
|
|
32
|
+
Promise.try(() => 42).then(it => console.log(it)); // => 42
|
|
33
33
|
|
|
34
34
|
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
|
|
35
35
|
|
|
36
36
|
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
|
|
37
37
|
|
|
38
|
-
(function * (i) { while (true) yield i++; }
|
|
38
|
+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
|
|
39
39
|
.drop(1).take(5)
|
|
40
40
|
.filter(it => it % 2)
|
|
41
41
|
.map(it => it ** 2)
|
|
@@ -53,13 +53,13 @@ import 'core-js/actual/array/from';
|
|
|
53
53
|
import 'core-js/actual/array/flat-map';
|
|
54
54
|
import 'core-js/actual/structured-clone';
|
|
55
55
|
|
|
56
|
-
Promise.
|
|
56
|
+
Promise.try(() => 42).then(it => console.log(it)); // => 42
|
|
57
57
|
|
|
58
58
|
Array.from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
|
|
59
59
|
|
|
60
60
|
[1, 2].flatMap(it => [it, it]); // => [1, 1, 2, 2]
|
|
61
61
|
|
|
62
|
-
(function * (i) { while (true) yield i++; }
|
|
62
|
+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
|
|
63
63
|
.drop(1).take(5)
|
|
64
64
|
.filter(it => it % 2)
|
|
65
65
|
.map(it => it ** 2)
|
|
@@ -77,13 +77,13 @@ import from from 'core-js-pure/actual/array/from';
|
|
|
77
77
|
import flatMap from 'core-js-pure/actual/array/flat-map';
|
|
78
78
|
import structuredClone from 'core-js-pure/actual/structured-clone';
|
|
79
79
|
|
|
80
|
-
Promise.
|
|
80
|
+
Promise.try(() => 42).then(it => console.log(it)); // => 42
|
|
81
81
|
|
|
82
82
|
from(new Set([1, 2, 3]).union(new Set([3, 4, 5]))); // => [1, 2, 3, 4, 5]
|
|
83
83
|
|
|
84
84
|
flatMap([1, 2], it => [it, it]); // => [1, 1, 2, 2]
|
|
85
85
|
|
|
86
|
-
Iterator.
|
|
86
|
+
Iterator.concat([1, 2], function * (i) { while (true) yield i++; }(3))
|
|
87
87
|
.drop(1).take(5)
|
|
88
88
|
.filter(it => it % 2)
|
|
89
89
|
.map(it => it ** 2)
|
|
@@ -7,9 +7,9 @@ var SHARED = '__core-js_shared__';
|
|
|
7
7
|
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
|
|
8
8
|
|
|
9
9
|
(store.versions || (store.versions = [])).push({
|
|
10
|
-
version: '3.45.
|
|
10
|
+
version: '3.45.1',
|
|
11
11
|
mode: IS_PURE ? 'pure' : 'global',
|
|
12
12
|
copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
|
|
13
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.45.
|
|
13
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE',
|
|
14
14
|
source: 'https://github.com/zloirock/core-js'
|
|
15
15
|
});
|
|
@@ -3,6 +3,7 @@ var $ = require('../internals/export');
|
|
|
3
3
|
var aCallable = require('../internals/a-callable');
|
|
4
4
|
var aMap = require('../internals/a-map');
|
|
5
5
|
var MapHelpers = require('../internals/map-helpers');
|
|
6
|
+
var IS_PURE = require('../internals/is-pure');
|
|
6
7
|
|
|
7
8
|
var get = MapHelpers.get;
|
|
8
9
|
var has = MapHelpers.has;
|
|
@@ -10,7 +11,7 @@ var set = MapHelpers.set;
|
|
|
10
11
|
|
|
11
12
|
// `Map.prototype.getOrInsertComputed` method
|
|
12
13
|
// https://github.com/tc39/proposal-upsert
|
|
13
|
-
$({ target: 'Map', proto: true, real: true }, {
|
|
14
|
+
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
|
|
14
15
|
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
|
|
15
16
|
aMap(this);
|
|
16
17
|
aCallable(callbackfn);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var aMap = require('../internals/a-map');
|
|
4
4
|
var MapHelpers = require('../internals/map-helpers');
|
|
5
|
+
var IS_PURE = require('../internals/is-pure');
|
|
5
6
|
|
|
6
7
|
var get = MapHelpers.get;
|
|
7
8
|
var has = MapHelpers.has;
|
|
@@ -9,7 +10,7 @@ var set = MapHelpers.set;
|
|
|
9
10
|
|
|
10
11
|
// `Map.prototype.getOrInsert` method
|
|
11
12
|
// https://github.com/tc39/proposal-upsert
|
|
12
|
-
$({ target: 'Map', proto: true, real: true }, {
|
|
13
|
+
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
|
|
13
14
|
getOrInsert: function getOrInsert(key, value) {
|
|
14
15
|
if (has(aMap(this), key)) return get(this, key);
|
|
15
16
|
set(this, key, value);
|
|
@@ -4,6 +4,7 @@ var aCallable = require('../internals/a-callable');
|
|
|
4
4
|
var aWeakMap = require('../internals/a-weak-map');
|
|
5
5
|
var aWeakKey = require('../internals/a-weak-key');
|
|
6
6
|
var WeakMapHelpers = require('../internals/weak-map-helpers');
|
|
7
|
+
var IS_PURE = require('../internals/is-pure');
|
|
7
8
|
|
|
8
9
|
var get = WeakMapHelpers.get;
|
|
9
10
|
var has = WeakMapHelpers.has;
|
|
@@ -11,7 +12,7 @@ var set = WeakMapHelpers.set;
|
|
|
11
12
|
|
|
12
13
|
// `WeakMap.prototype.getOrInsertComputed` method
|
|
13
14
|
// https://github.com/tc39/proposal-upsert
|
|
14
|
-
$({ target: 'WeakMap', proto: true, real: true }, {
|
|
15
|
+
$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {
|
|
15
16
|
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
|
|
16
17
|
aWeakMap(this);
|
|
17
18
|
aWeakKey(key);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
var $ = require('../internals/export');
|
|
3
3
|
var aWeakMap = require('../internals/a-weak-map');
|
|
4
4
|
var WeakMapHelpers = require('../internals/weak-map-helpers');
|
|
5
|
+
var IS_PURE = require('../internals/is-pure');
|
|
5
6
|
|
|
6
7
|
var get = WeakMapHelpers.get;
|
|
7
8
|
var has = WeakMapHelpers.has;
|
|
@@ -9,7 +10,7 @@ var set = WeakMapHelpers.set;
|
|
|
9
10
|
|
|
10
11
|
// `WeakMap.prototype.getOrInsert` method
|
|
11
12
|
// https://github.com/tc39/proposal-upsert
|
|
12
|
-
$({ target: 'WeakMap', proto: true, real: true }, {
|
|
13
|
+
$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {
|
|
13
14
|
getOrInsert: function getOrInsert(key, value) {
|
|
14
15
|
if (has(aWeakMap(this), key)) return get(this, key);
|
|
15
16
|
set(this, key, value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "core-js-pure",
|
|
3
|
-
"version": "3.45.
|
|
3
|
+
"version": "3.45.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "Standard library",
|
|
6
6
|
"keywords": [
|
|
@@ -56,6 +56,9 @@
|
|
|
56
56
|
"url": "git+https://github.com/zloirock/core-js.git",
|
|
57
57
|
"directory": "packages/core-js-pure"
|
|
58
58
|
},
|
|
59
|
+
"bugs": {
|
|
60
|
+
"url": "https://github.com/zloirock/core-js/issues"
|
|
61
|
+
},
|
|
59
62
|
"funding": {
|
|
60
63
|
"type": "opencollective",
|
|
61
64
|
"url": "https://opencollective.com/core-js"
|