core-js 3.30.2 → 3.31.0
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/actual/function/index.js +1 -0
- package/actual/function/metadata.js +3 -0
- package/actual/instance/is-well-formed.js +2 -9
- package/actual/instance/to-well-formed.js +2 -9
- package/actual/string/index.js +1 -0
- package/actual/string/is-well-formed.js +4 -1
- package/actual/string/to-well-formed.js +4 -1
- package/actual/string/virtual/index.js +1 -0
- package/actual/string/virtual/is-well-formed.js +4 -1
- package/actual/string/virtual/to-well-formed.js +4 -1
- package/actual/symbol/index.js +2 -0
- package/actual/symbol/metadata.js +5 -0
- package/es/index.js +2 -0
- package/es/instance/is-well-formed.js +10 -0
- package/es/instance/to-well-formed.js +10 -0
- package/es/string/index.js +2 -0
- package/es/string/is-well-formed.js +3 -0
- package/es/string/to-well-formed.js +3 -0
- package/es/string/virtual/is-well-formed.js +3 -0
- package/es/string/virtual/to-well-formed.js +3 -0
- package/features/function/metadata.js +1 -0
- package/features/object/group-by.js +1 -0
- package/features/promise/with-resolvers.js +1 -0
- package/features/symbol/is-registered-symbol.js +1 -0
- package/features/symbol/is-well-known-symbol.js +1 -0
- package/full/function/metadata.js +3 -0
- package/full/index.js +11 -2
- package/full/object/group-by.js +6 -0
- package/full/object/index.js +1 -0
- package/full/promise/index.js +2 -1
- package/full/promise/with-resolvers.js +13 -0
- package/full/symbol/index.js +5 -4
- package/full/symbol/is-registered-symbol.js +5 -0
- package/full/symbol/is-well-known-symbol.js +5 -0
- package/full/symbol/metadata.js +2 -3
- package/internals/array-buffer-transfer.js +6 -4
- package/internals/array-group.js +1 -1
- package/internals/get-iterator-direct.js +4 -3
- package/internals/object-to-array.js +13 -1
- package/internals/shared.js +2 -2
- package/internals/symbol-is-registered.js +16 -0
- package/internals/symbol-is-well-known.js +33 -0
- package/internals/url-constructor-detection.js +3 -1
- package/modules/es.string.is-well-formed.js +23 -0
- package/modules/es.string.to-well-formed.js +43 -0
- package/modules/esnext.async-disposable-stack.constructor.js +1 -1
- package/modules/esnext.function.metadata.js +13 -0
- package/modules/esnext.map.group-by.js +17 -16
- package/modules/esnext.object.group-by.js +30 -0
- package/modules/esnext.promise.with-resolvers.js +16 -0
- package/modules/esnext.string.is-well-formed.js +2 -23
- package/modules/esnext.string.to-well-formed.js +2 -42
- package/modules/esnext.symbol.is-registered-symbol.js +8 -0
- package/modules/esnext.symbol.is-registered.js +4 -15
- package/modules/esnext.symbol.is-well-known-symbol.js +9 -0
- package/modules/esnext.symbol.is-well-known.js +4 -31
- package/modules/web.url-search-params.constructor.js +22 -14
- package/modules/web.url-search-params.delete.js +46 -0
- package/modules/web.url-search-params.has.js +26 -0
- package/package.json +1 -1
- package/postinstall.js +1 -1
- package/proposals/array-grouping-v2.js +3 -0
- package/proposals/decorator-metadata-v2.js +1 -0
- package/proposals/promise-with-resolvers.js +2 -0
- package/proposals/symbol-predicates-v2.js +3 -0
- package/proposals/url.js +1 -5
- package/stable/index.js +4 -0
- package/stable/instance/is-well-formed.js +3 -0
- package/stable/instance/to-well-formed.js +3 -0
- package/stable/string/is-well-formed.js +3 -0
- package/stable/string/to-well-formed.js +3 -0
- package/stable/string/virtual/is-well-formed.js +3 -0
- package/stable/string/virtual/to-well-formed.js +3 -0
- package/stage/2.js +4 -2
- package/stage/3.js +2 -2
- package/stage/4.js +1 -0
- package/web/index.js +2 -0
- package/web/url-search-params.js +2 -0
- package/web/url.js +1 -2
package/actual/function/index.js
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
var method = require('../string/virtual/is-well-formed');
|
|
1
|
+
var parent = require('../../stable/instance/is-well-formed');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module.exports = function (it) {
|
|
7
|
-
var own = it.isWellFormed;
|
|
8
|
-
return typeof it == 'string' || it === StringPrototype
|
|
9
|
-
|| (isPrototypeOf(StringPrototype, it) && own === StringPrototype.isWellFormed) ? method : own;
|
|
10
|
-
};
|
|
3
|
+
module.exports = parent;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
var
|
|
2
|
-
var method = require('../string/virtual/to-well-formed');
|
|
1
|
+
var parent = require('../../stable/instance/to-well-formed');
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module.exports = function (it) {
|
|
7
|
-
var own = it.toWellFormed;
|
|
8
|
-
return typeof it == 'string' || it === StringPrototype
|
|
9
|
-
|| (isPrototypeOf(StringPrototype, it) && own === StringPrototype.toWellFormed) ? method : own;
|
|
10
|
-
};
|
|
3
|
+
module.exports = parent;
|
package/actual/string/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// TODO: Remove from `core-js@4`
|
|
1
2
|
require('../../modules/esnext.string.is-well-formed');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var parent = require('../../stable/string/is-well-formed');
|
|
5
|
+
|
|
6
|
+
module.exports = parent;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// TODO: Remove from `core-js@4`
|
|
1
2
|
require('../../modules/esnext.string.to-well-formed');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var parent = require('../../stable/string/to-well-formed');
|
|
5
|
+
|
|
6
|
+
module.exports = parent;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// TODO: Remove from `core-js@4`
|
|
1
2
|
require('../../../modules/esnext.string.is-well-formed');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var parent = require('../../../stable/string/virtual/is-well-formed');
|
|
5
|
+
|
|
6
|
+
module.exports = parent;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// TODO: Remove from `core-js@4`
|
|
1
2
|
require('../../../modules/esnext.string.to-well-formed');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
var parent = require('../../../stable/string/virtual/to-well-formed');
|
|
5
|
+
|
|
6
|
+
module.exports = parent;
|
package/actual/symbol/index.js
CHANGED
package/es/index.js
CHANGED
|
@@ -166,6 +166,7 @@ require('../modules/es.string.code-point-at');
|
|
|
166
166
|
require('../modules/es.string.ends-with');
|
|
167
167
|
require('../modules/es.string.from-code-point');
|
|
168
168
|
require('../modules/es.string.includes');
|
|
169
|
+
require('../modules/es.string.is-well-formed');
|
|
169
170
|
require('../modules/es.string.iterator');
|
|
170
171
|
require('../modules/es.string.match');
|
|
171
172
|
require('../modules/es.string.match-all');
|
|
@@ -179,6 +180,7 @@ require('../modules/es.string.search');
|
|
|
179
180
|
require('../modules/es.string.split');
|
|
180
181
|
require('../modules/es.string.starts-with');
|
|
181
182
|
require('../modules/es.string.substr');
|
|
183
|
+
require('../modules/es.string.to-well-formed');
|
|
182
184
|
require('../modules/es.string.trim');
|
|
183
185
|
require('../modules/es.string.trim-end');
|
|
184
186
|
require('../modules/es.string.trim-start');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var isPrototypeOf = require('../../internals/object-is-prototype-of');
|
|
2
|
+
var method = require('../string/virtual/is-well-formed');
|
|
3
|
+
|
|
4
|
+
var StringPrototype = String.prototype;
|
|
5
|
+
|
|
6
|
+
module.exports = function (it) {
|
|
7
|
+
var own = it.isWellFormed;
|
|
8
|
+
return typeof it == 'string' || it === StringPrototype
|
|
9
|
+
|| (isPrototypeOf(StringPrototype, it) && own === StringPrototype.isWellFormed) ? method : own;
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var isPrototypeOf = require('../../internals/object-is-prototype-of');
|
|
2
|
+
var method = require('../string/virtual/to-well-formed');
|
|
3
|
+
|
|
4
|
+
var StringPrototype = String.prototype;
|
|
5
|
+
|
|
6
|
+
module.exports = function (it) {
|
|
7
|
+
var own = it.toWellFormed;
|
|
8
|
+
return typeof it == 'string' || it === StringPrototype
|
|
9
|
+
|| (isPrototypeOf(StringPrototype, it) && own === StringPrototype.toWellFormed) ? method : own;
|
|
10
|
+
};
|
package/es/string/index.js
CHANGED
|
@@ -6,6 +6,7 @@ require('../../modules/es.string.code-point-at');
|
|
|
6
6
|
require('../../modules/es.string.at-alternative');
|
|
7
7
|
require('../../modules/es.string.ends-with');
|
|
8
8
|
require('../../modules/es.string.includes');
|
|
9
|
+
require('../../modules/es.string.is-well-formed');
|
|
9
10
|
require('../../modules/es.string.match');
|
|
10
11
|
require('../../modules/es.string.match-all');
|
|
11
12
|
require('../../modules/es.string.pad-end');
|
|
@@ -17,6 +18,7 @@ require('../../modules/es.string.search');
|
|
|
17
18
|
require('../../modules/es.string.split');
|
|
18
19
|
require('../../modules/es.string.starts-with');
|
|
19
20
|
require('../../modules/es.string.substr');
|
|
21
|
+
require('../../modules/es.string.to-well-formed');
|
|
20
22
|
require('../../modules/es.string.trim');
|
|
21
23
|
require('../../modules/es.string.trim-start');
|
|
22
24
|
require('../../modules/es.string.trim-end');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../full/function/metadata');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../full/object/group-by');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../full/promise/with-resolvers');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../full/symbol/is-registered-symbol');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../../full/symbol/is-well-known-symbol');
|
package/full/index.js
CHANGED
|
@@ -166,6 +166,7 @@ require('../modules/es.string.code-point-at');
|
|
|
166
166
|
require('../modules/es.string.ends-with');
|
|
167
167
|
require('../modules/es.string.from-code-point');
|
|
168
168
|
require('../modules/es.string.includes');
|
|
169
|
+
require('../modules/es.string.is-well-formed');
|
|
169
170
|
require('../modules/es.string.iterator');
|
|
170
171
|
require('../modules/es.string.match');
|
|
171
172
|
require('../modules/es.string.match-all');
|
|
@@ -179,6 +180,7 @@ require('../modules/es.string.search');
|
|
|
179
180
|
require('../modules/es.string.split');
|
|
180
181
|
require('../modules/es.string.starts-with');
|
|
181
182
|
require('../modules/es.string.substr');
|
|
183
|
+
require('../modules/es.string.to-well-formed');
|
|
182
184
|
require('../modules/es.string.trim');
|
|
183
185
|
require('../modules/es.string.trim-end');
|
|
184
186
|
require('../modules/es.string.trim-start');
|
|
@@ -285,6 +287,7 @@ require('../modules/esnext.disposable-stack.constructor');
|
|
|
285
287
|
require('../modules/esnext.function.demethodize');
|
|
286
288
|
require('../modules/esnext.function.is-callable');
|
|
287
289
|
require('../modules/esnext.function.is-constructor');
|
|
290
|
+
require('../modules/esnext.function.metadata');
|
|
288
291
|
require('../modules/esnext.function.un-this');
|
|
289
292
|
require('../modules/esnext.global-this');
|
|
290
293
|
require('../modules/esnext.iterator.constructor');
|
|
@@ -347,10 +350,12 @@ require('../modules/esnext.object.has-own');
|
|
|
347
350
|
require('../modules/esnext.object.iterate-entries');
|
|
348
351
|
require('../modules/esnext.object.iterate-keys');
|
|
349
352
|
require('../modules/esnext.object.iterate-values');
|
|
353
|
+
require('../modules/esnext.object.group-by');
|
|
350
354
|
require('../modules/esnext.observable');
|
|
351
355
|
require('../modules/esnext.promise.all-settled');
|
|
352
356
|
require('../modules/esnext.promise.any');
|
|
353
357
|
require('../modules/esnext.promise.try');
|
|
358
|
+
require('../modules/esnext.promise.with-resolvers');
|
|
354
359
|
require('../modules/esnext.reflect.define-metadata');
|
|
355
360
|
require('../modules/esnext.reflect.delete-metadata');
|
|
356
361
|
require('../modules/esnext.reflect.get-metadata');
|
|
@@ -389,13 +394,13 @@ require('../modules/esnext.string.at');
|
|
|
389
394
|
require('../modules/esnext.string.cooked');
|
|
390
395
|
require('../modules/esnext.string.code-points');
|
|
391
396
|
require('../modules/esnext.string.dedent');
|
|
392
|
-
require('../modules/esnext.string.is-well-formed');
|
|
393
397
|
require('../modules/esnext.string.match-all');
|
|
394
398
|
require('../modules/esnext.string.replace-all');
|
|
395
|
-
require('../modules/esnext.string.to-well-formed');
|
|
396
399
|
require('../modules/esnext.symbol.async-dispose');
|
|
397
400
|
require('../modules/esnext.symbol.dispose');
|
|
401
|
+
require('../modules/esnext.symbol.is-registered-symbol');
|
|
398
402
|
require('../modules/esnext.symbol.is-registered');
|
|
403
|
+
require('../modules/esnext.symbol.is-well-known-symbol');
|
|
399
404
|
require('../modules/esnext.symbol.is-well-known');
|
|
400
405
|
require('../modules/esnext.symbol.matcher');
|
|
401
406
|
require('../modules/esnext.symbol.metadata');
|
|
@@ -440,6 +445,10 @@ require('../modules/web.url');
|
|
|
440
445
|
require('../modules/web.url.can-parse');
|
|
441
446
|
require('../modules/web.url.to-json');
|
|
442
447
|
require('../modules/web.url-search-params');
|
|
448
|
+
require('../modules/web.url-search-params.delete');
|
|
449
|
+
require('../modules/web.url-search-params.has');
|
|
443
450
|
require('../modules/web.url-search-params.size');
|
|
451
|
+
require('../modules/esnext.string.is-well-formed');
|
|
452
|
+
require('../modules/esnext.string.to-well-formed');
|
|
444
453
|
|
|
445
454
|
module.exports = require('../internals/path');
|
package/full/object/index.js
CHANGED
package/full/promise/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
var parent = require('../../actual/promise');
|
|
2
|
-
require('../../modules/esnext.
|
|
2
|
+
require('../../modules/esnext.promise.with-resolvers');
|
|
3
3
|
// TODO: Remove from `core-js@4`
|
|
4
|
+
require('../../modules/esnext.aggregate-error');
|
|
4
5
|
require('../../modules/esnext.promise.all-settled');
|
|
5
6
|
require('../../modules/esnext.promise.try');
|
|
6
7
|
require('../../modules/esnext.promise.any');
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
require('../../modules/es.promise');
|
|
3
|
+
require('../../modules/esnext.promise.with-resolvers');
|
|
4
|
+
var call = require('../../internals/function-call');
|
|
5
|
+
var isCallable = require('../../internals/is-callable');
|
|
6
|
+
var path = require('../../internals/path');
|
|
7
|
+
|
|
8
|
+
var Promise = path.Promise;
|
|
9
|
+
var promiseWithResolvers = Promise.withResolvers;
|
|
10
|
+
|
|
11
|
+
module.exports = function withResolvers() {
|
|
12
|
+
return call(promiseWithResolvers, isCallable(this) ? this : Promise);
|
|
13
|
+
};
|
package/full/symbol/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
var parent = require('../../actual/symbol');
|
|
2
2
|
require('../../modules/esnext.symbol.async-dispose');
|
|
3
|
-
require('../../modules/esnext.symbol.is-registered');
|
|
4
|
-
require('../../modules/esnext.symbol.is-well-known');
|
|
3
|
+
require('../../modules/esnext.symbol.is-registered-symbol');
|
|
4
|
+
require('../../modules/esnext.symbol.is-well-known-symbol');
|
|
5
5
|
require('../../modules/esnext.symbol.matcher');
|
|
6
|
-
require('../../modules/esnext.symbol.metadata-key');
|
|
7
6
|
require('../../modules/esnext.symbol.observable');
|
|
8
7
|
// TODO: Remove from `core-js@4`
|
|
9
|
-
require('../../modules/esnext.symbol.
|
|
8
|
+
require('../../modules/esnext.symbol.is-registered');
|
|
9
|
+
require('../../modules/esnext.symbol.is-well-known');
|
|
10
|
+
require('../../modules/esnext.symbol.metadata-key');
|
|
10
11
|
require('../../modules/esnext.symbol.pattern-match');
|
|
11
12
|
require('../../modules/esnext.symbol.replace-all');
|
|
12
13
|
|
package/full/symbol/metadata.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
require('../../
|
|
2
|
-
var WrappedWellKnownSymbolModule = require('../../internals/well-known-symbol-wrapped');
|
|
1
|
+
var parent = require('../../actual/symbol/metadata');
|
|
3
2
|
|
|
4
|
-
module.exports =
|
|
3
|
+
module.exports = parent;
|
|
@@ -21,15 +21,17 @@ var setInt8 = uncurryThis(DataViewPrototype.setInt8);
|
|
|
21
21
|
|
|
22
22
|
module.exports = PROPER_TRANSFER && function (arrayBuffer, newLength, preserveResizability) {
|
|
23
23
|
var byteLength = arrayBufferByteLength(arrayBuffer);
|
|
24
|
-
var newByteLength = newLength === undefined ? byteLength :
|
|
24
|
+
var newByteLength = newLength === undefined ? byteLength : toIndex(newLength);
|
|
25
25
|
var fixedLength = !isResizable || !isResizable(arrayBuffer);
|
|
26
26
|
if (isDetached(arrayBuffer)) throw TypeError('ArrayBuffer is detached');
|
|
27
27
|
var newBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
|
|
28
28
|
if (byteLength == newByteLength && (preserveResizability || fixedLength)) return newBuffer;
|
|
29
|
-
if (!preserveResizability || fixedLength) return slice(newBuffer, 0, newByteLength);
|
|
30
|
-
var
|
|
29
|
+
if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) return slice(newBuffer, 0, newByteLength);
|
|
30
|
+
var options = (preserveResizability && !fixedLength) && maxByteLength ? { maxByteLength: maxByteLength(newBuffer) } : undefined;
|
|
31
|
+
var newNewBuffer = new ArrayBuffer(newByteLength, options);
|
|
31
32
|
var a = new DataView(newBuffer);
|
|
32
33
|
var b = new DataView(newNewBuffer);
|
|
33
|
-
|
|
34
|
+
var copyLength = min(newByteLength, byteLength);
|
|
35
|
+
for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i));
|
|
34
36
|
return newNewBuffer;
|
|
35
37
|
};
|
package/internals/array-group.js
CHANGED
|
@@ -21,7 +21,7 @@ module.exports = function ($this, callbackfn, that, specificConstructor) {
|
|
|
21
21
|
for (;length > index; index++) {
|
|
22
22
|
value = self[index];
|
|
23
23
|
key = toPropertyKey(boundFunction(value, index, O));
|
|
24
|
-
// in some
|
|
24
|
+
// in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
|
|
25
25
|
// but since it's a `null` prototype object, we can safely use `in`
|
|
26
26
|
if (key in target) push(target[key], value);
|
|
27
27
|
else target[key] = [value];
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// `GetIteratorDirect(obj)` abstract operation
|
|
2
|
+
// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
|
|
3
3
|
module.exports = function (obj) {
|
|
4
4
|
return {
|
|
5
5
|
iterator: obj,
|
|
6
|
-
next:
|
|
6
|
+
next: obj.next,
|
|
7
|
+
done: false
|
|
7
8
|
};
|
|
8
9
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
2
|
+
var fails = require('../internals/fails');
|
|
2
3
|
var uncurryThis = require('../internals/function-uncurry-this');
|
|
4
|
+
var objectGetPrototypeOf = require('../internals/object-get-prototype-of');
|
|
3
5
|
var objectKeys = require('../internals/object-keys');
|
|
4
6
|
var toIndexedObject = require('../internals/to-indexed-object');
|
|
5
7
|
var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;
|
|
@@ -7,18 +9,28 @@ var $propertyIsEnumerable = require('../internals/object-property-is-enumerable'
|
|
|
7
9
|
var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
|
|
8
10
|
var push = uncurryThis([].push);
|
|
9
11
|
|
|
12
|
+
// in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
|
|
13
|
+
// of `null` prototype objects
|
|
14
|
+
var IE_BUG = DESCRIPTORS && fails(function () {
|
|
15
|
+
// eslint-disable-next-line es/no-object-create -- safe
|
|
16
|
+
var O = Object.create(null);
|
|
17
|
+
O[2] = 2;
|
|
18
|
+
return !propertyIsEnumerable(O, 2);
|
|
19
|
+
});
|
|
20
|
+
|
|
10
21
|
// `Object.{ entries, values }` methods implementation
|
|
11
22
|
var createMethod = function (TO_ENTRIES) {
|
|
12
23
|
return function (it) {
|
|
13
24
|
var O = toIndexedObject(it);
|
|
14
25
|
var keys = objectKeys(O);
|
|
26
|
+
var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
|
|
15
27
|
var length = keys.length;
|
|
16
28
|
var i = 0;
|
|
17
29
|
var result = [];
|
|
18
30
|
var key;
|
|
19
31
|
while (length > i) {
|
|
20
32
|
key = keys[i++];
|
|
21
|
-
if (!DESCRIPTORS || propertyIsEnumerable(O, key)) {
|
|
33
|
+
if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
|
|
22
34
|
push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
|
|
23
35
|
}
|
|
24
36
|
}
|
package/internals/shared.js
CHANGED
|
@@ -4,9 +4,9 @@ var store = require('../internals/shared-store');
|
|
|
4
4
|
(module.exports = function (key, value) {
|
|
5
5
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
6
6
|
})('versions', []).push({
|
|
7
|
-
version: '3.
|
|
7
|
+
version: '3.31.0',
|
|
8
8
|
mode: IS_PURE ? 'pure' : 'global',
|
|
9
9
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
10
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
10
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.31.0/LICENSE',
|
|
11
11
|
source: 'https://github.com/zloirock/core-js'
|
|
12
12
|
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var getBuiltIn = require('../internals/get-built-in');
|
|
2
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
3
|
+
|
|
4
|
+
var Symbol = getBuiltIn('Symbol');
|
|
5
|
+
var keyFor = Symbol.keyFor;
|
|
6
|
+
var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);
|
|
7
|
+
|
|
8
|
+
// `Symbol.isRegisteredSymbol` method
|
|
9
|
+
// https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
|
10
|
+
module.exports = Symbol.isRegisteredSymbol || function isRegisteredSymbol(value) {
|
|
11
|
+
try {
|
|
12
|
+
return keyFor(thisSymbolValue(value)) !== undefined;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var shared = require('../internals/shared');
|
|
2
|
+
var getBuiltIn = require('../internals/get-built-in');
|
|
3
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
4
|
+
var isSymbol = require('../internals/is-symbol');
|
|
5
|
+
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
6
|
+
|
|
7
|
+
var Symbol = getBuiltIn('Symbol');
|
|
8
|
+
var $isWellKnownSymbol = Symbol.isWellKnownSymbol;
|
|
9
|
+
var getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames');
|
|
10
|
+
var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);
|
|
11
|
+
var WellKnownSymbolsStore = shared('wks');
|
|
12
|
+
|
|
13
|
+
for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) {
|
|
14
|
+
// some old engines throws on access to some keys like `arguments` or `caller`
|
|
15
|
+
try {
|
|
16
|
+
var symbolKey = symbolKeys[i];
|
|
17
|
+
if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey);
|
|
18
|
+
} catch (error) { /* empty */ }
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// `Symbol.isWellKnownSymbol` method
|
|
22
|
+
// https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
|
23
|
+
// We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
|
24
|
+
module.exports = function isWellKnownSymbol(value) {
|
|
25
|
+
if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true;
|
|
26
|
+
try {
|
|
27
|
+
var symbol = thisSymbolValue(value);
|
|
28
|
+
for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {
|
|
29
|
+
if (WellKnownSymbolsStore[keys[j]] == symbol) return true;
|
|
30
|
+
}
|
|
31
|
+
} catch (error) { /* empty */ }
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
@@ -9,13 +9,15 @@ module.exports = !fails(function () {
|
|
|
9
9
|
// eslint-disable-next-line unicorn/relative-url-style -- required for testing
|
|
10
10
|
var url = new URL('b?a=1&b=2&c=3', 'http://a');
|
|
11
11
|
var searchParams = url.searchParams;
|
|
12
|
+
var searchParams2 = new URLSearchParams('a=1&a=2');
|
|
12
13
|
var result = '';
|
|
13
14
|
url.pathname = 'c%20d';
|
|
14
15
|
searchParams.forEach(function (value, key) {
|
|
15
16
|
searchParams['delete']('b');
|
|
16
17
|
result += key + value;
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
+
searchParams2['delete']('a', 2);
|
|
20
|
+
return (IS_PURE && (!url.toJSON || !searchParams2.has('a', 1) || searchParams2.has('a', 2)))
|
|
19
21
|
|| (!searchParams.size && (IS_PURE || !DESCRIPTORS))
|
|
20
22
|
|| !searchParams.sort
|
|
21
23
|
|| url.href !== 'http://a/c%20d?a=1&c=3'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var $ = require('../internals/export');
|
|
3
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
4
|
+
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
5
|
+
var toString = require('../internals/to-string');
|
|
6
|
+
|
|
7
|
+
var charCodeAt = uncurryThis(''.charCodeAt);
|
|
8
|
+
|
|
9
|
+
// `String.prototype.isWellFormed` method
|
|
10
|
+
// https://github.com/tc39/proposal-is-usv-string
|
|
11
|
+
$({ target: 'String', proto: true }, {
|
|
12
|
+
isWellFormed: function isWellFormed() {
|
|
13
|
+
var S = toString(requireObjectCoercible(this));
|
|
14
|
+
var length = S.length;
|
|
15
|
+
for (var i = 0; i < length; i++) {
|
|
16
|
+
var charCode = charCodeAt(S, i);
|
|
17
|
+
// single UTF-16 code unit
|
|
18
|
+
if ((charCode & 0xF800) != 0xD800) continue;
|
|
19
|
+
// unpaired surrogate
|
|
20
|
+
if (charCode >= 0xDC00 || ++i >= length || (charCodeAt(S, i) & 0xFC00) != 0xDC00) return false;
|
|
21
|
+
} return true;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
var $ = require('../internals/export');
|
|
3
|
+
var call = require('../internals/function-call');
|
|
4
|
+
var uncurryThis = require('../internals/function-uncurry-this');
|
|
5
|
+
var requireObjectCoercible = require('../internals/require-object-coercible');
|
|
6
|
+
var toString = require('../internals/to-string');
|
|
7
|
+
var fails = require('../internals/fails');
|
|
8
|
+
|
|
9
|
+
var $Array = Array;
|
|
10
|
+
var charAt = uncurryThis(''.charAt);
|
|
11
|
+
var charCodeAt = uncurryThis(''.charCodeAt);
|
|
12
|
+
var join = uncurryThis([].join);
|
|
13
|
+
// eslint-disable-next-line es/no-string-prototype-iswellformed-towellformed -- safe
|
|
14
|
+
var $toWellFormed = ''.toWellFormed;
|
|
15
|
+
var REPLACEMENT_CHARACTER = '\uFFFD';
|
|
16
|
+
|
|
17
|
+
// Safari bug
|
|
18
|
+
var TO_STRING_CONVERSION_BUG = $toWellFormed && fails(function () {
|
|
19
|
+
return call($toWellFormed, 1) !== '1';
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// `String.prototype.toWellFormed` method
|
|
23
|
+
// https://github.com/tc39/proposal-is-usv-string
|
|
24
|
+
$({ target: 'String', proto: true, forced: TO_STRING_CONVERSION_BUG }, {
|
|
25
|
+
toWellFormed: function toWellFormed() {
|
|
26
|
+
var S = toString(requireObjectCoercible(this));
|
|
27
|
+
if (TO_STRING_CONVERSION_BUG) return call($toWellFormed, S);
|
|
28
|
+
var length = S.length;
|
|
29
|
+
var result = $Array(length);
|
|
30
|
+
for (var i = 0; i < length; i++) {
|
|
31
|
+
var charCode = charCodeAt(S, i);
|
|
32
|
+
// single UTF-16 code unit
|
|
33
|
+
if ((charCode & 0xF800) != 0xD800) result[i] = charAt(S, i);
|
|
34
|
+
// unpaired surrogate
|
|
35
|
+
else if (charCode >= 0xDC00 || i + 1 >= length || (charCodeAt(S, i + 1) & 0xFC00) != 0xDC00) result[i] = REPLACEMENT_CHARACTER;
|
|
36
|
+
// surrogate pair
|
|
37
|
+
else {
|
|
38
|
+
result[i] = charAt(S, i);
|
|
39
|
+
result[++i] = charAt(S, i);
|
|
40
|
+
}
|
|
41
|
+
} return join(result, '');
|
|
42
|
+
}
|
|
43
|
+
});
|
|
@@ -95,7 +95,7 @@ defineBuiltIns(AsyncDisposableStackPrototype, {
|
|
|
95
95
|
var internalState = getPendingAsyncDisposableStackInternalState(this);
|
|
96
96
|
aCallable(onDispose);
|
|
97
97
|
addDisposableResource(internalState, undefined, HINT, function () {
|
|
98
|
-
onDispose(value);
|
|
98
|
+
return onDispose(value);
|
|
99
99
|
});
|
|
100
100
|
return value;
|
|
101
101
|
},
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
2
|
+
var defineProperty = require('../internals/object-define-property').f;
|
|
3
|
+
|
|
4
|
+
var METADATA = wellKnownSymbol('metadata');
|
|
5
|
+
var FunctionPrototype = Function.prototype;
|
|
6
|
+
|
|
7
|
+
// Function.prototype[@@metadata]
|
|
8
|
+
// https://github.com/tc39/proposal-decorator-metadata
|
|
9
|
+
if (FunctionPrototype[METADATA] === undefined) {
|
|
10
|
+
defineProperty(FunctionPrototype, METADATA, {
|
|
11
|
+
value: null
|
|
12
|
+
});
|
|
13
|
+
}
|