core-js-pure 3.33.2 → 3.34.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.
Files changed (61) hide show
  1. package/actual/map/group-by.js +2 -10
  2. package/actual/object/group-by.js +2 -4
  3. package/actual/promise/with-resolvers.js +3 -10
  4. package/es/index.js +3 -0
  5. package/es/map/group-by.js +13 -0
  6. package/es/map/index.js +1 -0
  7. package/es/object/group-by.js +7 -0
  8. package/es/object/index.js +1 -0
  9. package/es/promise/index.js +1 -0
  10. package/es/promise/with-resolvers.js +13 -0
  11. package/features/typed-array/from-base64.js +2 -0
  12. package/features/typed-array/from-hex.js +2 -0
  13. package/features/typed-array/to-base64.js +2 -0
  14. package/features/typed-array/to-hex.js +2 -0
  15. package/full/index.js +7 -0
  16. package/full/typed-array/from-base64.js +2 -0
  17. package/full/typed-array/from-hex.js +2 -0
  18. package/full/typed-array/index.js +4 -0
  19. package/full/typed-array/methods.js +4 -0
  20. package/full/typed-array/to-base64.js +2 -0
  21. package/full/typed-array/to-hex.js +2 -0
  22. package/internals/a-string.js +7 -0
  23. package/internals/an-object-or-undefined.js +10 -0
  24. package/internals/an-uint8-array.js +11 -0
  25. package/internals/array-from-constructor-and-list.js +2 -2
  26. package/internals/array-iteration-from-last.js +1 -1
  27. package/internals/array-iteration.js +1 -1
  28. package/internals/array-reduce.js +1 -1
  29. package/internals/base64-map.js +14 -5
  30. package/internals/engine-is-bun.js +1 -1
  31. package/internals/get-alphabet-option.js +8 -0
  32. package/internals/global.js +2 -1
  33. package/internals/set-to-string-tag.js +2 -2
  34. package/internals/shared.js +2 -2
  35. package/modules/es.map.group-by.js +31 -0
  36. package/modules/es.object.group-by.js +30 -0
  37. package/modules/es.promise.with-resolvers.js +16 -0
  38. package/modules/esnext.iterator.constructor.js +27 -7
  39. package/modules/esnext.map.group-by.js +2 -30
  40. package/modules/esnext.number.from-string.js +4 -4
  41. package/modules/esnext.object.group-by.js +2 -29
  42. package/modules/esnext.promise.with-resolvers.js +2 -15
  43. package/modules/esnext.string.dedent.js +7 -12
  44. package/modules/esnext.uint8-array.from-base64.js +1 -0
  45. package/modules/esnext.uint8-array.from-hex.js +1 -0
  46. package/modules/esnext.uint8-array.to-base64.js +1 -0
  47. package/modules/esnext.uint8-array.to-hex.js +1 -0
  48. package/modules/web.atob.js +20 -15
  49. package/modules/web.btoa.js +11 -7
  50. package/modules/web.dom-collections.iterator.js +2 -10
  51. package/modules/web.structured-clone.js +1 -0
  52. package/package.json +1 -1
  53. package/proposals/array-buffer-base64.js +6 -0
  54. package/proposals/well-formed-unicode-strings.js +1 -0
  55. package/stable/index.js +3 -0
  56. package/stable/map/group-by.js +4 -0
  57. package/stable/object/group-by.js +4 -0
  58. package/stable/promise/with-resolvers.js +4 -0
  59. package/stage/2.js +1 -0
  60. package/stage/3.js +0 -2
  61. package/stage/4.js +2 -0
@@ -1,13 +1,5 @@
1
1
  'use strict';
2
- require('../../modules/es.map');
2
+ var parent = require('../../stable/map/group-by');
3
3
  require('../../modules/esnext.map.group-by');
4
- var call = require('../../internals/function-call');
5
- var isCallable = require('../../internals/is-callable');
6
- var path = require('../../internals/path');
7
4
 
8
- var Map = path.Map;
9
- var mapGroupBy = Map.groupBy;
10
-
11
- module.exports = function groupBy(source, iterable, keyDerivative) {
12
- return call(mapGroupBy, isCallable(this) ? this : Map, source, iterable, keyDerivative);
13
- };
5
+ module.exports = parent;
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
- require('../../modules/es.object.create');
2
+ var parent = require('../../stable/object/group-by');
3
3
  require('../../modules/esnext.object.group-by');
4
4
 
5
- var path = require('../../internals/path');
6
-
7
- module.exports = path.Object.groupBy;
5
+ module.exports = parent;
@@ -1,13 +1,6 @@
1
1
  'use strict';
2
- require('../../modules/es.promise');
2
+ var parent = require('../../stable/promise/with-resolvers');
3
+ // TODO: Remove from `core-js@4`
3
4
  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
5
 
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
- };
6
+ module.exports = parent;
package/es/index.js CHANGED
@@ -76,6 +76,7 @@ require('../modules/es.global-this');
76
76
  require('../modules/es.json.stringify');
77
77
  require('../modules/es.json.to-string-tag');
78
78
  require('../modules/es.map');
79
+ require('../modules/es.map.group-by');
79
80
  require('../modules/es.math.acosh');
80
81
  require('../modules/es.math.asinh');
81
82
  require('../modules/es.math.atanh');
@@ -120,6 +121,7 @@ require('../modules/es.object.get-own-property-descriptor');
120
121
  require('../modules/es.object.get-own-property-descriptors');
121
122
  require('../modules/es.object.get-own-property-names');
122
123
  require('../modules/es.object.get-prototype-of');
124
+ require('../modules/es.object.group-by');
123
125
  require('../modules/es.object.has-own');
124
126
  require('../modules/es.object.is');
125
127
  require('../modules/es.object.is-extensible');
@@ -140,6 +142,7 @@ require('../modules/es.promise');
140
142
  require('../modules/es.promise.all-settled');
141
143
  require('../modules/es.promise.any');
142
144
  require('../modules/es.promise.finally');
145
+ require('../modules/es.promise.with-resolvers');
143
146
  require('../modules/es.reflect.apply');
144
147
  require('../modules/es.reflect.construct');
145
148
  require('../modules/es.reflect.define-property');
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+ require('../../modules/es.map');
3
+ require('../../modules/es.map.group-by');
4
+ var call = require('../../internals/function-call');
5
+ var isCallable = require('../../internals/is-callable');
6
+ var path = require('../../internals/path');
7
+
8
+ var Map = path.Map;
9
+ var mapGroupBy = Map.groupBy;
10
+
11
+ module.exports = function groupBy(source, iterable, keyDerivative) {
12
+ return call(mapGroupBy, isCallable(this) ? this : Map, source, iterable, keyDerivative);
13
+ };
package/es/map/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  require('../../modules/es.array.iterator');
3
3
  require('../../modules/es.map');
4
+ require('../../modules/es.map.group-by');
4
5
  require('../../modules/es.object.to-string');
5
6
  require('../../modules/es.string.iterator');
6
7
  var path = require('../../internals/path');
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+ require('../../modules/es.object.create');
3
+ require('../../modules/es.object.group-by');
4
+
5
+ var path = require('../../internals/path');
6
+
7
+ module.exports = path.Object.groupBy;
@@ -11,6 +11,7 @@ require('../../modules/es.object.get-own-property-descriptor');
11
11
  require('../../modules/es.object.get-own-property-descriptors');
12
12
  require('../../modules/es.object.get-own-property-names');
13
13
  require('../../modules/es.object.get-prototype-of');
14
+ require('../../modules/es.object.group-by');
14
15
  require('../../modules/es.object.has-own');
15
16
  require('../../modules/es.object.is');
16
17
  require('../../modules/es.object.is-extensible');
@@ -5,6 +5,7 @@ require('../../modules/es.object.to-string');
5
5
  require('../../modules/es.promise');
6
6
  require('../../modules/es.promise.all-settled');
7
7
  require('../../modules/es.promise.any');
8
+ require('../../modules/es.promise.with-resolvers');
8
9
  require('../../modules/es.promise.finally');
9
10
  require('../../modules/es.string.iterator');
10
11
  var path = require('../../internals/path');
@@ -0,0 +1,13 @@
1
+ 'use strict';
2
+ require('../../modules/es.promise');
3
+ require('../../modules/es.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
+ };
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ module.exports = require('../../full/typed-array/from-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ module.exports = require('../../full/typed-array/from-hex');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ module.exports = require('../../full/typed-array/to-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ module.exports = require('../../full/typed-array/to-hex');
package/full/index.js CHANGED
@@ -76,6 +76,7 @@ require('../modules/es.global-this');
76
76
  require('../modules/es.json.stringify');
77
77
  require('../modules/es.json.to-string-tag');
78
78
  require('../modules/es.map');
79
+ require('../modules/es.map.group-by');
79
80
  require('../modules/es.math.acosh');
80
81
  require('../modules/es.math.asinh');
81
82
  require('../modules/es.math.atanh');
@@ -120,6 +121,7 @@ require('../modules/es.object.get-own-property-descriptor');
120
121
  require('../modules/es.object.get-own-property-descriptors');
121
122
  require('../modules/es.object.get-own-property-names');
122
123
  require('../modules/es.object.get-prototype-of');
124
+ require('../modules/es.object.group-by');
123
125
  require('../modules/es.object.has-own');
124
126
  require('../modules/es.object.is');
125
127
  require('../modules/es.object.is-extensible');
@@ -140,6 +142,7 @@ require('../modules/es.promise');
140
142
  require('../modules/es.promise.all-settled');
141
143
  require('../modules/es.promise.any');
142
144
  require('../modules/es.promise.finally');
145
+ require('../modules/es.promise.with-resolvers');
143
146
  require('../modules/es.reflect.apply');
144
147
  require('../modules/es.reflect.construct');
145
148
  require('../modules/es.reflect.define-property');
@@ -429,6 +432,10 @@ require('../modules/esnext.typed-array.to-sorted');
429
432
  require('../modules/esnext.typed-array.to-spliced');
430
433
  require('../modules/esnext.typed-array.unique-by');
431
434
  require('../modules/esnext.typed-array.with');
435
+ require('../modules/esnext.uint8-array.from-base64');
436
+ require('../modules/esnext.uint8-array.from-hex');
437
+ require('../modules/esnext.uint8-array.to-base64');
438
+ require('../modules/esnext.uint8-array.to-hex');
432
439
  require('../modules/esnext.weak-map.delete-all');
433
440
  require('../modules/esnext.weak-map.from');
434
441
  require('../modules/esnext.weak-map.of');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/esnext.uint8-array.from-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/esnext.uint8-array.from-hex');
@@ -10,5 +10,9 @@ require('../../modules/esnext.typed-array.filter-out');
10
10
  require('../../modules/esnext.typed-array.filter-reject');
11
11
  require('../../modules/esnext.typed-array.group-by');
12
12
  require('../../modules/esnext.typed-array.unique-by');
13
+ require('../../modules/esnext.uint8-array.from-base64');
14
+ require('../../modules/esnext.uint8-array.from-hex');
15
+ require('../../modules/esnext.uint8-array.to-base64');
16
+ require('../../modules/esnext.uint8-array.to-hex');
13
17
 
14
18
  module.exports = parent;
@@ -10,5 +10,9 @@ require('../../modules/esnext.typed-array.filter-out');
10
10
  require('../../modules/esnext.typed-array.filter-reject');
11
11
  require('../../modules/esnext.typed-array.group-by');
12
12
  require('../../modules/esnext.typed-array.unique-by');
13
+ require('../../modules/esnext.uint8-array.from-base64');
14
+ require('../../modules/esnext.uint8-array.from-hex');
15
+ require('../../modules/esnext.uint8-array.to-base64');
16
+ require('../../modules/esnext.uint8-array.to-hex');
13
17
 
14
18
  module.exports = parent;
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/esnext.uint8-array.to-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/esnext.uint8-array.to-hex');
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+ var $TypeError = TypeError;
3
+
4
+ module.exports = function (argument) {
5
+ if (typeof argument == 'string') return argument;
6
+ throw new $TypeError('Argument is not a string');
7
+ };
@@ -0,0 +1,10 @@
1
+ 'use strict';
2
+ var isObject = require('../internals/is-object');
3
+
4
+ var $String = String;
5
+ var $TypeError = TypeError;
6
+
7
+ module.exports = function (argument) {
8
+ if (argument === undefined || isObject(argument)) return argument;
9
+ throw new $TypeError($String(argument) + ' is not an object or undefined');
10
+ };
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var classof = require('../internals/classof');
3
+
4
+ var $TypeError = TypeError;
5
+
6
+ // Perform ? RequireInternalSlot(argument, [[TypedArrayName]])
7
+ // If argument.[[TypedArrayName]] is not "Uint8Array", throw a TypeError exception
8
+ module.exports = function (argument) {
9
+ if (classof(argument) === 'Uint8Array') return argument;
10
+ throw new $TypeError('Argument is not an Uint8Array');
11
+ };
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
  var lengthOfArrayLike = require('../internals/length-of-array-like');
3
3
 
4
- module.exports = function (Constructor, list) {
4
+ module.exports = function (Constructor, list, $length) {
5
5
  var index = 0;
6
- var length = lengthOfArrayLike(list);
6
+ var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
7
7
  var result = new Constructor(length);
8
8
  while (length > index) result[index] = list[index++];
9
9
  return result;
@@ -10,8 +10,8 @@ var createMethod = function (TYPE) {
10
10
  return function ($this, callbackfn, that) {
11
11
  var O = toObject($this);
12
12
  var self = IndexedObject(O);
13
- var boundFunction = bind(callbackfn, that);
14
13
  var index = lengthOfArrayLike(self);
14
+ var boundFunction = bind(callbackfn, that);
15
15
  var value, result;
16
16
  while (index-- > 0) {
17
17
  value = self[index];
@@ -20,8 +20,8 @@ var createMethod = function (TYPE) {
20
20
  return function ($this, callbackfn, that, specificCreate) {
21
21
  var O = toObject($this);
22
22
  var self = IndexedObject(O);
23
- var boundFunction = bind(callbackfn, that);
24
23
  var length = lengthOfArrayLike(self);
24
+ var boundFunction = bind(callbackfn, that);
25
25
  var index = 0;
26
26
  var create = specificCreate || arraySpeciesCreate;
27
27
  var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
@@ -9,10 +9,10 @@ var $TypeError = TypeError;
9
9
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
10
10
  var createMethod = function (IS_RIGHT) {
11
11
  return function (that, callbackfn, argumentsLength, memo) {
12
- aCallable(callbackfn);
13
12
  var O = toObject(that);
14
13
  var self = IndexedObject(O);
15
14
  var length = lengthOfArrayLike(O);
15
+ aCallable(callbackfn);
16
16
  var index = IS_RIGHT ? length - 1 : 0;
17
17
  var i = IS_RIGHT ? -1 : 1;
18
18
  if (argumentsLength < 2) while (true) {
@@ -1,10 +1,19 @@
1
1
  'use strict';
2
- var itoc = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
3
- var ctoi = {};
2
+ var commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
3
+ var base64Alphabet = commonAlphabet + '+/';
4
+ var base64UrlAlphabet = commonAlphabet + '-_';
4
5
 
5
- for (var index = 0; index < 66; index++) ctoi[itoc.charAt(index)] = index;
6
+ var inverse = function (characters) {
7
+ // TODO: use `Object.create(null)` in `core-js@4`
8
+ var result = {};
9
+ var index = 0;
10
+ for (; index < 64; index++) result[characters.charAt(index)] = index;
11
+ return result;
12
+ };
6
13
 
7
14
  module.exports = {
8
- itoc: itoc,
9
- ctoi: ctoi
15
+ i2c: base64Alphabet,
16
+ c2i: inverse(base64Alphabet),
17
+ i2cUrl: base64UrlAlphabet,
18
+ c2iUrl: inverse(base64UrlAlphabet)
10
19
  };
@@ -1,3 +1,3 @@
1
1
  'use strict';
2
- /* global Bun -- Deno case */
2
+ /* global Bun -- Bun case */
3
3
  module.exports = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ var $TypeError = TypeError;
3
+
4
+ module.exports = function (options) {
5
+ var alphabet = options && options.alphabet;
6
+ if (alphabet === undefined || alphabet === 'base64' || alphabet === 'base64url') return alphabet || 'base64';
7
+ throw new $TypeError('Incorrect `alphabet` option');
8
+ };
@@ -11,5 +11,6 @@ module.exports =
11
11
  // eslint-disable-next-line no-restricted-globals -- safe
12
12
  check(typeof self == 'object' && self) ||
13
13
  check(typeof global == 'object' && global) ||
14
+ check(typeof this == 'object' && this) ||
14
15
  // eslint-disable-next-line no-new-func -- fallback
15
- (function () { return this; })() || this || Function('return this')();
16
+ (function () { return this; })() || Function('return this')();
@@ -9,8 +9,8 @@ var wellKnownSymbol = require('../internals/well-known-symbol');
9
9
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
10
10
 
11
11
  module.exports = function (it, TAG, STATIC, SET_METHOD) {
12
- if (it) {
13
- var target = STATIC ? it : it.prototype;
12
+ var target = STATIC ? it : it && it.prototype;
13
+ if (target) {
14
14
  if (!hasOwn(target, TO_STRING_TAG)) {
15
15
  defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
16
16
  }
@@ -5,9 +5,9 @@ var store = require('../internals/shared-store');
5
5
  (module.exports = function (key, value) {
6
6
  return store[key] || (store[key] = value !== undefined ? value : {});
7
7
  })('versions', []).push({
8
- version: '3.33.2',
8
+ version: '3.34.0',
9
9
  mode: IS_PURE ? 'pure' : 'global',
10
10
  copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
11
- license: 'https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE',
11
+ license: 'https://github.com/zloirock/core-js/blob/v3.34.0/LICENSE',
12
12
  source: 'https://github.com/zloirock/core-js'
13
13
  });
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var uncurryThis = require('../internals/function-uncurry-this');
4
+ var aCallable = require('../internals/a-callable');
5
+ var requireObjectCoercible = require('../internals/require-object-coercible');
6
+ var iterate = require('../internals/iterate');
7
+ var MapHelpers = require('../internals/map-helpers');
8
+ var IS_PURE = require('../internals/is-pure');
9
+
10
+ var Map = MapHelpers.Map;
11
+ var has = MapHelpers.has;
12
+ var get = MapHelpers.get;
13
+ var set = MapHelpers.set;
14
+ var push = uncurryThis([].push);
15
+
16
+ // `Map.groupBy` method
17
+ // https://github.com/tc39/proposal-array-grouping
18
+ $({ target: 'Map', stat: true, forced: IS_PURE }, {
19
+ groupBy: function groupBy(items, callbackfn) {
20
+ requireObjectCoercible(items);
21
+ aCallable(callbackfn);
22
+ var map = new Map();
23
+ var k = 0;
24
+ iterate(items, function (value) {
25
+ var key = callbackfn(value, k++);
26
+ if (!has(map, key)) set(map, key, [value]);
27
+ else push(get(map, key), value);
28
+ });
29
+ return map;
30
+ }
31
+ });
@@ -0,0 +1,30 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var getBuiltIn = require('../internals/get-built-in');
4
+ var uncurryThis = require('../internals/function-uncurry-this');
5
+ var aCallable = require('../internals/a-callable');
6
+ var requireObjectCoercible = require('../internals/require-object-coercible');
7
+ var toPropertyKey = require('../internals/to-property-key');
8
+ var iterate = require('../internals/iterate');
9
+
10
+ var create = getBuiltIn('Object', 'create');
11
+ var push = uncurryThis([].push);
12
+
13
+ // `Object.groupBy` method
14
+ // https://github.com/tc39/proposal-array-grouping
15
+ $({ target: 'Object', stat: true }, {
16
+ groupBy: function groupBy(items, callbackfn) {
17
+ requireObjectCoercible(items);
18
+ aCallable(callbackfn);
19
+ var obj = create(null);
20
+ var k = 0;
21
+ iterate(items, function (value) {
22
+ var key = toPropertyKey(callbackfn(value, k++));
23
+ // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
24
+ // but since it's a `null` prototype object, we can safely use `in`
25
+ if (key in obj) push(obj[key], value);
26
+ else obj[key] = [value];
27
+ });
28
+ return obj;
29
+ }
30
+ });
@@ -0,0 +1,16 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var newPromiseCapabilityModule = require('../internals/new-promise-capability');
4
+
5
+ // `Promise.withResolvers` method
6
+ // https://github.com/tc39/proposal-promise-with-resolvers
7
+ $({ target: 'Promise', stat: true }, {
8
+ withResolvers: function withResolvers() {
9
+ var promiseCapability = newPromiseCapabilityModule.f(this);
10
+ return {
11
+ promise: promiseCapability.promise,
12
+ resolve: promiseCapability.resolve,
13
+ reject: promiseCapability.reject
14
+ };
15
+ }
16
+ });
@@ -2,19 +2,24 @@
2
2
  var $ = require('../internals/export');
3
3
  var global = require('../internals/global');
4
4
  var anInstance = require('../internals/an-instance');
5
+ var anObject = require('../internals/an-object');
5
6
  var isCallable = require('../internals/is-callable');
6
7
  var getPrototypeOf = require('../internals/object-get-prototype-of');
7
- var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
8
+ var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
9
+ var createProperty = require('../internals/create-property');
8
10
  var fails = require('../internals/fails');
9
11
  var hasOwn = require('../internals/has-own-property');
10
12
  var wellKnownSymbol = require('../internals/well-known-symbol');
11
13
  var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
14
+ var DESCRIPTORS = require('../internals/descriptors');
12
15
  var IS_PURE = require('../internals/is-pure');
13
16
 
17
+ var CONSTRUCTOR = 'constructor';
18
+ var ITERATOR = 'Iterator';
14
19
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
15
20
 
16
21
  var $TypeError = TypeError;
17
- var NativeIterator = global.Iterator;
22
+ var NativeIterator = global[ITERATOR];
18
23
 
19
24
  // FF56- have non-standard global helper `Iterator`
20
25
  var FORCED = IS_PURE
@@ -28,12 +33,27 @@ var IteratorConstructor = function Iterator() {
28
33
  if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
29
34
  };
30
35
 
31
- if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) {
32
- createNonEnumerableProperty(IteratorPrototype, TO_STRING_TAG, 'Iterator');
33
- }
36
+ var defineIteratorPrototypeAccessor = function (key, value) {
37
+ if (DESCRIPTORS) {
38
+ defineBuiltInAccessor(IteratorPrototype, key, {
39
+ configurable: true,
40
+ get: function () {
41
+ return value;
42
+ },
43
+ set: function (replacement) {
44
+ anObject(this);
45
+ if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
46
+ if (hasOwn(this, key)) this[key] = replacement;
47
+ else createProperty(this, key, replacement);
48
+ }
49
+ });
50
+ } else IteratorPrototype[key] = value;
51
+ };
52
+
53
+ if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
34
54
 
35
- if (FORCED || !hasOwn(IteratorPrototype, 'constructor') || IteratorPrototype.constructor === Object) {
36
- createNonEnumerableProperty(IteratorPrototype, 'constructor', IteratorConstructor);
55
+ if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
56
+ defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
37
57
  }
38
58
 
39
59
  IteratorConstructor.prototype = IteratorPrototype;
@@ -1,31 +1,3 @@
1
1
  'use strict';
2
- var $ = require('../internals/export');
3
- var uncurryThis = require('../internals/function-uncurry-this');
4
- var aCallable = require('../internals/a-callable');
5
- var requireObjectCoercible = require('../internals/require-object-coercible');
6
- var iterate = require('../internals/iterate');
7
- var MapHelpers = require('../internals/map-helpers');
8
- var IS_PURE = require('../internals/is-pure');
9
-
10
- var Map = MapHelpers.Map;
11
- var has = MapHelpers.has;
12
- var get = MapHelpers.get;
13
- var set = MapHelpers.set;
14
- var push = uncurryThis([].push);
15
-
16
- // `Map.groupBy` method
17
- // https://github.com/tc39/proposal-array-grouping
18
- $({ target: 'Map', stat: true, forced: IS_PURE }, {
19
- groupBy: function groupBy(items, callbackfn) {
20
- requireObjectCoercible(items);
21
- aCallable(callbackfn);
22
- var map = new Map();
23
- var k = 0;
24
- iterate(items, function (value) {
25
- var key = callbackfn(value, k++);
26
- if (!has(map, key)) set(map, key, [value]);
27
- else push(get(map, key), value);
28
- });
29
- return map;
30
- }
31
- });
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.map.group-by');
@@ -2,13 +2,13 @@
2
2
  var $ = require('../internals/export');
3
3
  var uncurryThis = require('../internals/function-uncurry-this');
4
4
  var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
5
- var parseInt = require('../internals/number-parse-int');
6
5
 
7
6
  var INVALID_NUMBER_REPRESENTATION = 'Invalid number representation';
8
7
  var INVALID_RADIX = 'Invalid radix';
9
8
  var $RangeError = RangeError;
10
9
  var $SyntaxError = SyntaxError;
11
10
  var $TypeError = TypeError;
11
+ var $parseInt = parseInt;
12
12
  var pow = Math.pow;
13
13
  var valid = /^[\d.a-z]+$/;
14
14
  var charAt = uncurryThis(''.charAt);
@@ -33,9 +33,9 @@ $({ target: 'Number', stat: true, forced: true }, {
33
33
  if (R < 2 || R > 36) throw new $RangeError(INVALID_RADIX);
34
34
  if (!exec(valid, string)) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
35
35
  var parts = split(string, '.');
36
- var mathNum = parseInt(parts[0], R);
37
- if (parts.length > 1) mathNum += parseInt(parts[1], R) / pow(R, parts[1].length);
38
- if (numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
36
+ var mathNum = $parseInt(parts[0], R);
37
+ if (parts.length > 1) mathNum += $parseInt(parts[1], R) / pow(R, parts[1].length);
38
+ if (R === 10 && numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
39
39
  return sign * mathNum;
40
40
  }
41
41
  });
@@ -1,30 +1,3 @@
1
1
  'use strict';
2
- var $ = require('../internals/export');
3
- var getBuiltIn = require('../internals/get-built-in');
4
- var uncurryThis = require('../internals/function-uncurry-this');
5
- var aCallable = require('../internals/a-callable');
6
- var requireObjectCoercible = require('../internals/require-object-coercible');
7
- var toPropertyKey = require('../internals/to-property-key');
8
- var iterate = require('../internals/iterate');
9
-
10
- var create = getBuiltIn('Object', 'create');
11
- var push = uncurryThis([].push);
12
-
13
- // `Object.groupBy` method
14
- // https://github.com/tc39/proposal-array-grouping
15
- $({ target: 'Object', stat: true }, {
16
- groupBy: function groupBy(items, callbackfn) {
17
- requireObjectCoercible(items);
18
- aCallable(callbackfn);
19
- var obj = create(null);
20
- var k = 0;
21
- iterate(items, function (value) {
22
- var key = toPropertyKey(callbackfn(value, k++));
23
- // in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
24
- // but since it's a `null` prototype object, we can safely use `in`
25
- if (key in obj) push(obj[key], value);
26
- else obj[key] = [value];
27
- });
28
- return obj;
29
- }
30
- });
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.object.group-by');
@@ -1,16 +1,3 @@
1
1
  'use strict';
2
- var $ = require('../internals/export');
3
- var newPromiseCapabilityModule = require('../internals/new-promise-capability');
4
-
5
- // `Promise.withResolvers` method
6
- // https://github.com/tc39/proposal-promise-with-resolvers
7
- $({ target: 'Promise', stat: true }, {
8
- withResolvers: function withResolvers() {
9
- var promiseCapability = newPromiseCapabilityModule.f(this);
10
- return {
11
- promise: promiseCapability.promise,
12
- resolve: promiseCapability.resolve,
13
- reject: promiseCapability.reject
14
- };
15
- }
16
- });
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.promise.with-resolvers');
@@ -1,8 +1,6 @@
1
1
  'use strict';
2
2
  var FREEZING = require('../internals/freezing');
3
3
  var $ = require('../internals/export');
4
- var shared = require('../internals/shared');
5
- var getBuiltIn = require('../internals/get-built-in');
6
4
  var makeBuiltIn = require('../internals/make-built-in');
7
5
  var uncurryThis = require('../internals/function-uncurry-this');
8
6
  var apply = require('../internals/function-apply');
@@ -12,18 +10,15 @@ var isCallable = require('../internals/is-callable');
12
10
  var lengthOfArrayLike = require('../internals/length-of-array-like');
13
11
  var defineProperty = require('../internals/object-define-property').f;
14
12
  var createArrayFromList = require('../internals/array-slice-simple');
13
+ var WeakMapHelpers = require('../internals/weak-map-helpers');
15
14
  var cooked = require('../internals/string-cooked');
16
15
  var parse = require('../internals/string-parse');
17
16
  var whitespaces = require('../internals/whitespaces');
18
17
 
19
- var WeakMap = getBuiltIn('WeakMap');
20
- var globalDedentRegistry = shared('GlobalDedentRegistry', new WeakMap());
21
-
22
- /* eslint-disable no-self-assign -- prototype methods protection */
23
- globalDedentRegistry.has = globalDedentRegistry.has;
24
- globalDedentRegistry.get = globalDedentRegistry.get;
25
- globalDedentRegistry.set = globalDedentRegistry.set;
26
- /* eslint-enable no-self-assign -- prototype methods protection */
18
+ var DedentMap = new WeakMapHelpers.WeakMap();
19
+ var weakMapGet = WeakMapHelpers.get;
20
+ var weakMapHas = WeakMapHelpers.has;
21
+ var weakMapSet = WeakMapHelpers.set;
27
22
 
28
23
  var $Array = Array;
29
24
  var $TypeError = TypeError;
@@ -48,14 +43,14 @@ var dedentTemplateStringsArray = function (template) {
48
43
  var rawInput = template.raw;
49
44
  // https://github.com/tc39/proposal-string-dedent/issues/75
50
45
  if (FREEZING && !isFrozen(rawInput)) throw new $TypeError('Raw template should be frozen');
51
- if (globalDedentRegistry.has(rawInput)) return globalDedentRegistry.get(rawInput);
46
+ if (weakMapHas(DedentMap, rawInput)) return weakMapGet(DedentMap, rawInput);
52
47
  var raw = dedentStringsArray(rawInput);
53
48
  var cookedArr = cookStrings(raw);
54
49
  defineProperty(cookedArr, 'raw', {
55
50
  value: freeze(raw)
56
51
  });
57
52
  freeze(cookedArr);
58
- globalDedentRegistry.set(rawInput, cookedArr);
53
+ weakMapSet(DedentMap, rawInput, cookedArr);
59
54
  return cookedArr;
60
55
  };
61
56
 
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -6,9 +6,8 @@ var uncurryThis = require('../internals/function-uncurry-this');
6
6
  var call = require('../internals/function-call');
7
7
  var fails = require('../internals/fails');
8
8
  var toString = require('../internals/to-string');
9
- var hasOwn = require('../internals/has-own-property');
10
9
  var validateArgumentsLength = require('../internals/validate-arguments-length');
11
- var ctoi = require('../internals/base64-map').ctoi;
10
+ var c2i = require('../internals/base64-map').c2i;
12
11
 
13
12
  var disallowed = /[^\d+/a-z]/i;
14
13
  var whitespaces = /[\t\n\f\r ]+/g;
@@ -20,43 +19,49 @@ var charAt = uncurryThis(''.charAt);
20
19
  var replace = uncurryThis(''.replace);
21
20
  var exec = uncurryThis(disallowed.exec);
22
21
 
23
- var NO_SPACES_IGNORE = fails(function () {
22
+ var BASIC = !!$atob && !fails(function () {
23
+ return $atob('aGk=') !== 'hi';
24
+ });
25
+
26
+ var NO_SPACES_IGNORE = BASIC && fails(function () {
24
27
  return $atob(' ') !== '';
25
28
  });
26
29
 
27
- var NO_ENCODING_CHECK = !fails(function () {
30
+ var NO_ENCODING_CHECK = BASIC && !fails(function () {
28
31
  $atob('a');
29
32
  });
30
33
 
31
- var NO_ARG_RECEIVING_CHECK = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && !fails(function () {
34
+ var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function () {
32
35
  $atob();
33
36
  });
34
37
 
35
- var WRONG_ARITY = !NO_SPACES_IGNORE && !NO_ENCODING_CHECK && $atob.length !== 1;
38
+ var WRONG_ARITY = BASIC && $atob.length !== 1;
39
+
40
+ var FORCED = !BASIC || NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY;
36
41
 
37
42
  // `atob` method
38
43
  // https://html.spec.whatwg.org/multipage/webappapis.html#dom-atob
39
- $({ global: true, bind: true, enumerable: true, forced: NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY }, {
44
+ $({ global: true, bind: true, enumerable: true, forced: FORCED }, {
40
45
  atob: function atob(data) {
41
46
  validateArgumentsLength(arguments.length, 1);
42
47
  // `webpack` dev server bug on IE global methods - use call(fn, global, ...)
43
- if (NO_ARG_RECEIVING_CHECK || WRONG_ARITY) return call($atob, global, data);
48
+ if (BASIC && !NO_SPACES_IGNORE && !NO_ENCODING_CHECK) return call($atob, global, data);
44
49
  var string = replace(toString(data), whitespaces, '');
45
50
  var output = '';
46
51
  var position = 0;
47
52
  var bc = 0;
48
- var chr, bs;
53
+ var length, chr, bs;
49
54
  if (string.length % 4 === 0) {
50
55
  string = replace(string, finalEq, '');
51
56
  }
52
- if (string.length % 4 === 1 || exec(disallowed, string)) {
57
+ length = string.length;
58
+ if (length % 4 === 1 || exec(disallowed, string)) {
53
59
  throw new (getBuiltIn('DOMException'))('The string is not correctly encoded', 'InvalidCharacterError');
54
60
  }
55
- while (chr = charAt(string, position++)) {
56
- if (hasOwn(ctoi, chr)) {
57
- bs = bc % 4 ? bs * 64 + ctoi[chr] : ctoi[chr];
58
- if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6));
59
- }
61
+ while (position < length) {
62
+ chr = charAt(string, position++);
63
+ bs = bc % 4 ? bs * 64 + c2i[chr] : c2i[chr];
64
+ if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6));
60
65
  } return output;
61
66
  }
62
67
  });
@@ -7,33 +7,37 @@ var call = require('../internals/function-call');
7
7
  var fails = require('../internals/fails');
8
8
  var toString = require('../internals/to-string');
9
9
  var validateArgumentsLength = require('../internals/validate-arguments-length');
10
- var itoc = require('../internals/base64-map').itoc;
10
+ var i2c = require('../internals/base64-map').i2c;
11
11
 
12
12
  var $btoa = getBuiltIn('btoa');
13
13
  var charAt = uncurryThis(''.charAt);
14
14
  var charCodeAt = uncurryThis(''.charCodeAt);
15
15
 
16
- var NO_ARG_RECEIVING_CHECK = !!$btoa && !fails(function () {
16
+ var BASIC = !!$btoa && !fails(function () {
17
+ return $btoa('hi') !== 'aGk=';
18
+ });
19
+
20
+ var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function () {
17
21
  $btoa();
18
22
  });
19
23
 
20
- var WRONG_ARG_CONVERSION = !!$btoa && fails(function () {
24
+ var WRONG_ARG_CONVERSION = BASIC && fails(function () {
21
25
  return $btoa(null) !== 'bnVsbA==';
22
26
  });
23
27
 
24
- var WRONG_ARITY = !!$btoa && $btoa.length !== 1;
28
+ var WRONG_ARITY = BASIC && $btoa.length !== 1;
25
29
 
26
30
  // `btoa` method
27
31
  // https://html.spec.whatwg.org/multipage/webappapis.html#dom-btoa
28
- $({ global: true, bind: true, enumerable: true, forced: NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
32
+ $({ global: true, bind: true, enumerable: true, forced: !BASIC || NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
29
33
  btoa: function btoa(data) {
30
34
  validateArgumentsLength(arguments.length, 1);
31
35
  // `webpack` dev server bug on IE global methods - use call(fn, global, ...)
32
- if (NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY) return call($btoa, global, toString(data));
36
+ if (BASIC) return call($btoa, global, toString(data));
33
37
  var string = toString(data);
34
38
  var output = '';
35
39
  var position = 0;
36
- var map = itoc;
40
+ var map = i2c;
37
41
  var block, charCode;
38
42
  while (charAt(string, position) || (map = '=', position % 1)) {
39
43
  charCode = charCodeAt(string, position += 3 / 4);
@@ -2,18 +2,10 @@
2
2
  require('../modules/es.array.iterator');
3
3
  var DOMIterables = require('../internals/dom-iterables');
4
4
  var global = require('../internals/global');
5
- var classof = require('../internals/classof');
6
- var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
5
+ var setToStringTag = require('../internals/set-to-string-tag');
7
6
  var Iterators = require('../internals/iterators');
8
- var wellKnownSymbol = require('../internals/well-known-symbol');
9
-
10
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
11
7
 
12
8
  for (var COLLECTION_NAME in DOMIterables) {
13
- var Collection = global[COLLECTION_NAME];
14
- var CollectionPrototype = Collection && Collection.prototype;
15
- if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
16
- createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
17
- }
9
+ setToStringTag(global[COLLECTION_NAME], COLLECTION_NAME);
18
10
  Iterators[COLLECTION_NAME] = Iterators.Array;
19
11
  }
@@ -160,6 +160,7 @@ var cloneBuffer = function (value, map, $type) {
160
160
  } else {
161
161
  length = value.byteLength;
162
162
  options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined;
163
+ // eslint-disable-next-line es/no-resizable-and-growable-arraybuffers -- safe
163
164
  clone = new ArrayBuffer(length, options);
164
165
  source = new DataView(value);
165
166
  target = new DataView(clone);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
- "version": "3.33.2",
3
+ "version": "3.34.0",
4
4
  "type": "commonjs",
5
5
  "description": "Standard library",
6
6
  "keywords": [
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ // https://github.com/tc39/proposal-arraybuffer-base64
3
+ require('../modules/esnext.uint8-array.from-base64');
4
+ require('../modules/esnext.uint8-array.from-hex');
5
+ require('../modules/esnext.uint8-array.to-base64');
6
+ require('../modules/esnext.uint8-array.to-hex');
@@ -1,3 +1,4 @@
1
1
  'use strict';
2
+ // https://github.com/tc39/proposal-is-usv-string
2
3
  require('../modules/esnext.string.is-well-formed');
3
4
  require('../modules/esnext.string.to-well-formed');
package/stable/index.js CHANGED
@@ -76,6 +76,7 @@ require('../modules/es.global-this');
76
76
  require('../modules/es.json.stringify');
77
77
  require('../modules/es.json.to-string-tag');
78
78
  require('../modules/es.map');
79
+ require('../modules/es.map.group-by');
79
80
  require('../modules/es.math.acosh');
80
81
  require('../modules/es.math.asinh');
81
82
  require('../modules/es.math.atanh');
@@ -120,6 +121,7 @@ require('../modules/es.object.get-own-property-descriptor');
120
121
  require('../modules/es.object.get-own-property-descriptors');
121
122
  require('../modules/es.object.get-own-property-names');
122
123
  require('../modules/es.object.get-prototype-of');
124
+ require('../modules/es.object.group-by');
123
125
  require('../modules/es.object.has-own');
124
126
  require('../modules/es.object.is');
125
127
  require('../modules/es.object.is-extensible');
@@ -140,6 +142,7 @@ require('../modules/es.promise');
140
142
  require('../modules/es.promise.all-settled');
141
143
  require('../modules/es.promise.any');
142
144
  require('../modules/es.promise.finally');
145
+ require('../modules/es.promise.with-resolvers');
143
146
  require('../modules/es.reflect.apply');
144
147
  require('../modules/es.reflect.construct');
145
148
  require('../modules/es.reflect.define-property');
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/map/group-by');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/object/group-by');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/promise/with-resolvers');
3
+
4
+ module.exports = parent;
package/stage/2.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  var parent = require('./3');
3
3
 
4
+ require('../proposals/array-buffer-base64');
4
5
  require('../proposals/array-is-template-object');
5
6
  require('../proposals/async-iterator-helpers');
6
7
  require('../proposals/iterator-range');
package/stage/3.js CHANGED
@@ -3,13 +3,11 @@ var parent = require('./4');
3
3
 
4
4
  require('../proposals/array-buffer-transfer');
5
5
  require('../proposals/array-from-async-stage-2');
6
- require('../proposals/array-grouping-v2');
7
6
  require('../proposals/decorator-metadata-v2');
8
7
  require('../proposals/explicit-resource-management');
9
8
  require('../proposals/float16');
10
9
  require('../proposals/iterator-helpers-stage-3-2');
11
10
  require('../proposals/json-parse-with-source');
12
- require('../proposals/promise-with-resolvers');
13
11
  require('../proposals/set-methods-v2');
14
12
  // TODO: Obsolete versions, remove from `core-js@4`
15
13
  require('../proposals/array-grouping-stage-3');
package/stage/4.js CHANGED
@@ -2,11 +2,13 @@
2
2
  // TODO: Remove this entry from `core-js@4`
3
3
  require('../proposals/accessible-object-hasownproperty');
4
4
  require('../proposals/array-find-from-last');
5
+ require('../proposals/array-grouping-v2');
5
6
  require('../proposals/change-array-by-copy-stage-4');
6
7
  // require('../proposals/error-cause');
7
8
  require('../proposals/global-this');
8
9
  require('../proposals/promise-all-settled');
9
10
  require('../proposals/promise-any');
11
+ require('../proposals/promise-with-resolvers');
10
12
  require('../proposals/relative-indexing-method');
11
13
  require('../proposals/string-match-all');
12
14
  require('../proposals/string-replace-all-stage-4');