core-js-pure 3.44.0 → 3.45.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 (66) hide show
  1. package/actual/iterator/concat.js +21 -0
  2. package/actual/iterator/index.js +1 -0
  3. package/actual/map/get-or-insert-computed.js +6 -0
  4. package/actual/map/get-or-insert.js +6 -0
  5. package/actual/map/index.js +2 -0
  6. package/actual/math/index.js +0 -1
  7. package/actual/math/sum-precise.js +2 -3
  8. package/actual/typed-array/from-base64.js +3 -0
  9. package/actual/typed-array/from-hex.js +3 -0
  10. package/actual/typed-array/index.js +1 -1
  11. package/actual/typed-array/set-from-base64.js +3 -0
  12. package/actual/typed-array/set-from-hex.js +3 -0
  13. package/actual/typed-array/to-base64.js +3 -0
  14. package/actual/typed-array/to-hex.js +3 -0
  15. package/actual/weak-map/get-or-insert-computed.js +6 -0
  16. package/actual/weak-map/get-or-insert.js +6 -0
  17. package/actual/weak-map/index.js +2 -0
  18. package/es/index.js +7 -0
  19. package/es/math/index.js +2 -0
  20. package/es/math/sum-precise.js +6 -0
  21. package/es/typed-array/from-base64.js +2 -0
  22. package/es/typed-array/from-hex.js +2 -0
  23. package/es/typed-array/methods.js +6 -0
  24. package/es/typed-array/set-from-base64.js +2 -0
  25. package/es/typed-array/set-from-hex.js +2 -0
  26. package/es/typed-array/to-base64.js +2 -0
  27. package/es/typed-array/to-hex.js +2 -0
  28. package/full/index.js +7 -0
  29. package/full/iterator/concat.js +3 -19
  30. package/full/iterator/from.js +1 -0
  31. package/full/iterator/index.js +0 -1
  32. package/full/iterator/range.js +1 -0
  33. package/full/iterator/zip-keyed.js +1 -0
  34. package/full/iterator/zip.js +1 -0
  35. package/full/map/get-or-insert-computed.js +2 -4
  36. package/full/map/get-or-insert.js +2 -4
  37. package/full/weak-map/get-or-insert-computed.js +2 -4
  38. package/full/weak-map/get-or-insert.js +2 -4
  39. package/internals/shared-store.js +2 -2
  40. package/internals/uint8-from-base64.js +6 -5
  41. package/modules/es.math.sum-precise.js +151 -0
  42. package/modules/es.uint8-array.from-base64.js +1 -0
  43. package/modules/es.uint8-array.from-hex.js +1 -0
  44. package/modules/es.uint8-array.set-from-base64.js +1 -0
  45. package/modules/es.uint8-array.set-from-hex.js +1 -0
  46. package/modules/es.uint8-array.to-base64.js +1 -0
  47. package/modules/es.uint8-array.to-hex.js +1 -0
  48. package/modules/esnext.iterator.concat.js +1 -1
  49. package/modules/esnext.map.get-or-insert-computed.js +1 -1
  50. package/modules/esnext.map.get-or-insert.js +1 -1
  51. package/modules/esnext.math.sum-precise.js +2 -150
  52. package/modules/esnext.weak-map.get-or-insert-computed.js +1 -1
  53. package/modules/esnext.weak-map.get-or-insert.js +1 -1
  54. package/package.json +1 -1
  55. package/stable/index.js +7 -0
  56. package/stable/math/sum-precise.js +4 -0
  57. package/stable/typed-array/from-base64.js +4 -0
  58. package/stable/typed-array/from-hex.js +4 -0
  59. package/stable/typed-array/set-from-base64.js +4 -0
  60. package/stable/typed-array/set-from-hex.js +4 -0
  61. package/stable/typed-array/to-base64.js +4 -0
  62. package/stable/typed-array/to-hex.js +4 -0
  63. package/stage/2.7.js +1 -2
  64. package/stage/2.js +0 -1
  65. package/stage/3.js +2 -2
  66. package/stage/4.js +2 -0
@@ -0,0 +1,21 @@
1
+ 'use strict';
2
+ require('../../modules/es.array.iterator');
3
+ require('../../modules/es.object.to-string');
4
+ require('../../modules/es.string.iterator');
5
+ require('../../modules/es.iterator.constructor');
6
+ require('../../modules/es.iterator.drop');
7
+ require('../../modules/es.iterator.every');
8
+ require('../../modules/es.iterator.filter');
9
+ require('../../modules/es.iterator.find');
10
+ require('../../modules/es.iterator.flat-map');
11
+ require('../../modules/es.iterator.for-each');
12
+ require('../../modules/es.iterator.map');
13
+ require('../../modules/es.iterator.reduce');
14
+ require('../../modules/es.iterator.some');
15
+ require('../../modules/es.iterator.take');
16
+ require('../../modules/es.iterator.to-array');
17
+ require('../../modules/esnext.iterator.concat');
18
+ require('../../modules/web.dom-collections.iterator');
19
+ var path = require('../../internals/path');
20
+
21
+ module.exports = path.Iterator.concat;
@@ -2,6 +2,7 @@
2
2
  var parent = require('../../stable/iterator');
3
3
  require('../../modules/es.promise');
4
4
  require('../../modules/esnext.iterator.constructor');
5
+ require('../../modules/esnext.iterator.concat');
5
6
  require('../../modules/esnext.iterator.dispose');
6
7
  require('../../modules/esnext.iterator.drop');
7
8
  require('../../modules/esnext.iterator.every');
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ require('../../modules/es.map');
3
+ require('../../modules/esnext.map.get-or-insert-computed');
4
+ var entryUnbind = require('../../internals/entry-unbind');
5
+
6
+ module.exports = entryUnbind('Map', 'getOrInsertComputed');
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ require('../../modules/es.map');
3
+ require('../../modules/esnext.map.get-or-insert');
4
+ var entryUnbind = require('../../internals/entry-unbind');
5
+
6
+ module.exports = entryUnbind('Map', 'getOrInsert');
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
  var parent = require('../../stable/map');
3
+ require('../../modules/esnext.map.get-or-insert');
4
+ require('../../modules/esnext.map.get-or-insert-computed');
3
5
  require('../../modules/esnext.map.group-by');
4
6
 
5
7
  module.exports = parent;
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
  var parent = require('../../stable/math');
3
- require('../../modules/es.array.iterator');
4
3
  require('../../modules/esnext.math.f16round');
5
4
  require('../../modules/esnext.math.sum-precise');
6
5
 
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
- require('../../modules/es.array.iterator');
2
+ var parent = require('../../stable/math/sum-precise');
3
3
  require('../../modules/esnext.math.sum-precise');
4
- var path = require('../../internals/path');
5
4
 
6
- module.exports = path.Math.sumPrecise;
5
+ module.exports = parent;
@@ -1,2 +1,5 @@
1
1
  'use strict';
2
+ var parent = require('../../stable/typed-array/from-base64');
2
3
  require('../../modules/esnext.uint8-array.from-base64');
4
+
5
+ module.exports = parent;
@@ -1,2 +1,5 @@
1
1
  'use strict';
2
+ var parent = require('../../stable/typed-array/from-hex');
2
3
  require('../../modules/esnext.uint8-array.from-hex');
4
+
5
+ module.exports = parent;
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
  var parent = require('../../stable/typed-array');
3
+ // TODO: Remove from `core-js@4`
3
4
  require('../../modules/esnext.uint8-array.from-base64');
4
5
  require('../../modules/esnext.uint8-array.from-hex');
5
6
  require('../../modules/esnext.uint8-array.set-from-base64');
6
7
  require('../../modules/esnext.uint8-array.set-from-hex');
7
8
  require('../../modules/esnext.uint8-array.to-base64');
8
9
  require('../../modules/esnext.uint8-array.to-hex');
9
- // TODO: Remove from `core-js@4`
10
10
  require('../../modules/esnext.typed-array.find-last');
11
11
  require('../../modules/esnext.typed-array.find-last-index');
12
12
  require('../../modules/esnext.typed-array.to-reversed');
@@ -1,2 +1,5 @@
1
1
  'use strict';
2
+ var parent = require('../../stable/typed-array/set-from-base64');
2
3
  require('../../modules/esnext.uint8-array.set-from-base64');
4
+
5
+ module.exports = parent;
@@ -1,2 +1,5 @@
1
1
  'use strict';
2
+ var parent = require('../../stable/typed-array/set-from-hex');
2
3
  require('../../modules/esnext.uint8-array.set-from-hex');
4
+
5
+ module.exports = parent;
@@ -1,2 +1,5 @@
1
1
  'use strict';
2
+ var parent = require('../../stable/typed-array/to-base64');
2
3
  require('../../modules/esnext.uint8-array.to-base64');
4
+
5
+ module.exports = parent;
@@ -1,2 +1,5 @@
1
1
  'use strict';
2
+ var parent = require('../../stable/typed-array/to-hex');
2
3
  require('../../modules/esnext.uint8-array.to-hex');
4
+
5
+ module.exports = parent;
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ require('../../modules/es.weak-map');
3
+ require('../../modules/esnext.weak-map.get-or-insert-computed');
4
+ var entryUnbind = require('../../internals/entry-unbind');
5
+
6
+ module.exports = entryUnbind('WeakMap', 'getOrInsertComputed');
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ require('../../modules/es.weak-map');
3
+ require('../../modules/esnext.weak-map.get-or-insert');
4
+ var entryUnbind = require('../../internals/entry-unbind');
5
+
6
+ module.exports = entryUnbind('WeakMap', 'getOrInsert');
@@ -1,4 +1,6 @@
1
1
  'use strict';
2
2
  var parent = require('../../stable/weak-map');
3
+ require('../../modules/esnext.weak-map.get-or-insert');
4
+ require('../../modules/esnext.weak-map.get-or-insert-computed');
3
5
 
4
6
  module.exports = parent;
package/es/index.js CHANGED
@@ -117,6 +117,7 @@ require('../modules/es.math.log1p');
117
117
  require('../modules/es.math.log2');
118
118
  require('../modules/es.math.sign');
119
119
  require('../modules/es.math.sinh');
120
+ require('../modules/es.math.sum-precise');
120
121
  require('../modules/es.math.tanh');
121
122
  require('../modules/es.math.to-string-tag');
122
123
  require('../modules/es.math.trunc');
@@ -278,6 +279,12 @@ require('../modules/es.typed-array.to-reversed');
278
279
  require('../modules/es.typed-array.to-sorted');
279
280
  require('../modules/es.typed-array.to-string');
280
281
  require('../modules/es.typed-array.with');
282
+ require('../modules/es.uint8-array.from-base64');
283
+ require('../modules/es.uint8-array.from-hex');
284
+ require('../modules/es.uint8-array.set-from-base64');
285
+ require('../modules/es.uint8-array.set-from-hex');
286
+ require('../modules/es.uint8-array.to-base64');
287
+ require('../modules/es.uint8-array.to-hex');
281
288
  require('../modules/es.unescape');
282
289
  require('../modules/es.weak-map');
283
290
  require('../modules/es.weak-set');
package/es/math/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  'use strict';
2
+ require('../../modules/es.array.iterator');
2
3
  require('../../modules/es.math.acosh');
3
4
  require('../../modules/es.math.asinh');
4
5
  require('../../modules/es.math.atanh');
@@ -15,6 +16,7 @@ require('../../modules/es.math.log1p');
15
16
  require('../../modules/es.math.log2');
16
17
  require('../../modules/es.math.sign');
17
18
  require('../../modules/es.math.sinh');
19
+ require('../../modules/es.math.sum-precise');
18
20
  require('../../modules/es.math.tanh');
19
21
  require('../../modules/es.math.to-string-tag');
20
22
  require('../../modules/es.math.trunc');
@@ -0,0 +1,6 @@
1
+ 'use strict';
2
+ require('../../modules/es.array.iterator');
3
+ require('../../modules/es.math.sum-precise');
4
+ var path = require('../../internals/path');
5
+
6
+ module.exports = path.Math.sumPrecise;
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/es.uint8-array.from-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/es.uint8-array.from-hex');
@@ -32,3 +32,9 @@ require('../../modules/es.typed-array.to-reversed');
32
32
  require('../../modules/es.typed-array.to-sorted');
33
33
  require('../../modules/es.typed-array.with');
34
34
  require('../../modules/es.typed-array.iterator');
35
+ require('../../modules/es.uint8-array.from-base64');
36
+ require('../../modules/es.uint8-array.from-hex');
37
+ require('../../modules/es.uint8-array.set-from-base64');
38
+ require('../../modules/es.uint8-array.set-from-hex');
39
+ require('../../modules/es.uint8-array.to-base64');
40
+ require('../../modules/es.uint8-array.to-hex');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/es.uint8-array.set-from-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/es.uint8-array.set-from-hex');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/es.uint8-array.to-base64');
@@ -0,0 +1,2 @@
1
+ 'use strict';
2
+ require('../../modules/es.uint8-array.to-hex');
package/full/index.js CHANGED
@@ -117,6 +117,7 @@ require('../modules/es.math.log1p');
117
117
  require('../modules/es.math.log2');
118
118
  require('../modules/es.math.sign');
119
119
  require('../modules/es.math.sinh');
120
+ require('../modules/es.math.sum-precise');
120
121
  require('../modules/es.math.tanh');
121
122
  require('../modules/es.math.to-string-tag');
122
123
  require('../modules/es.math.trunc');
@@ -278,6 +279,12 @@ require('../modules/es.typed-array.to-reversed');
278
279
  require('../modules/es.typed-array.to-sorted');
279
280
  require('../modules/es.typed-array.to-string');
280
281
  require('../modules/es.typed-array.with');
282
+ require('../modules/es.uint8-array.from-base64');
283
+ require('../modules/es.uint8-array.from-hex');
284
+ require('../modules/es.uint8-array.set-from-base64');
285
+ require('../modules/es.uint8-array.set-from-hex');
286
+ require('../modules/es.uint8-array.to-base64');
287
+ require('../modules/es.uint8-array.to-hex');
281
288
  require('../modules/es.unescape');
282
289
  require('../modules/es.weak-map');
283
290
  require('../modules/es.weak-set');
@@ -1,23 +1,7 @@
1
1
  'use strict';
2
- require('../../modules/es.array.iterator');
3
- require('../../modules/es.object.to-string');
4
- require('../../modules/es.string.iterator');
5
- require('../../modules/es.iterator.constructor');
6
- require('../../modules/es.iterator.drop');
7
- require('../../modules/es.iterator.every');
8
- require('../../modules/es.iterator.filter');
9
- require('../../modules/es.iterator.find');
10
- require('../../modules/es.iterator.flat-map');
11
- require('../../modules/es.iterator.for-each');
12
- require('../../modules/es.iterator.map');
13
- require('../../modules/es.iterator.reduce');
14
- require('../../modules/es.iterator.some');
15
- require('../../modules/es.iterator.take');
16
- require('../../modules/es.iterator.to-array');
2
+ var parent = require('../../actual/iterator/concat');
17
3
  require('../../modules/esnext.iterator.chunks');
18
- require('../../modules/esnext.iterator.concat');
4
+ require('../../modules/esnext.iterator.sliding');
19
5
  require('../../modules/esnext.iterator.windows');
20
- require('../../modules/web.dom-collections.iterator');
21
- var path = require('../../internals/path');
22
6
 
23
- module.exports = path.Iterator.concat;
7
+ module.exports = parent;
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  var parent = require('../../actual/iterator/from');
3
3
  require('../../modules/esnext.iterator.chunks');
4
+ require('../../modules/esnext.iterator.sliding');
4
5
  require('../../modules/esnext.iterator.windows');
5
6
 
6
7
  module.exports = parent;
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
  var parent = require('../../actual/iterator');
3
3
  require('../../modules/esnext.iterator.chunks');
4
- require('../../modules/esnext.iterator.concat');
5
4
  require('../../modules/esnext.iterator.range');
6
5
  require('../../modules/esnext.iterator.sliding');
7
6
  require('../../modules/esnext.iterator.windows');
@@ -18,6 +18,7 @@ require('../../modules/esnext.iterator.chunks');
18
18
  // TODO: drop from core-js@4
19
19
  require('../../modules/esnext.iterator.constructor');
20
20
  require('../../modules/esnext.iterator.range');
21
+ require('../../modules/esnext.iterator.sliding');
21
22
  require('../../modules/esnext.iterator.windows');
22
23
  require('../../modules/web.dom-collections.iterator');
23
24
  var path = require('../../internals/path');
@@ -17,6 +17,7 @@ require('../../modules/es.iterator.take');
17
17
  require('../../modules/es.iterator.to-array');
18
18
  require('../../modules/es.reflect.own-keys');
19
19
  require('../../modules/esnext.iterator.chunks');
20
+ require('../../modules/esnext.iterator.sliding');
20
21
  require('../../modules/esnext.iterator.windows');
21
22
  require('../../modules/esnext.iterator.zip-keyed');
22
23
  require('../../modules/web.dom-collections.iterator');
@@ -15,6 +15,7 @@ require('../../modules/es.iterator.some');
15
15
  require('../../modules/es.iterator.take');
16
16
  require('../../modules/es.iterator.to-array');
17
17
  require('../../modules/esnext.iterator.chunks');
18
+ require('../../modules/esnext.iterator.sliding');
18
19
  require('../../modules/esnext.iterator.windows');
19
20
  require('../../modules/esnext.iterator.zip');
20
21
  require('../../modules/web.dom-collections.iterator');
@@ -1,6 +1,4 @@
1
1
  'use strict';
2
- require('../../modules/es.map');
3
- require('../../modules/esnext.map.get-or-insert-computed');
4
- var entryUnbind = require('../../internals/entry-unbind');
2
+ var parent = require('../../actual/map/get-or-insert-computed');
5
3
 
6
- module.exports = entryUnbind('Map', 'getOrInsertComputed');
4
+ module.exports = parent;
@@ -1,6 +1,4 @@
1
1
  'use strict';
2
- require('../../modules/es.map');
3
- require('../../modules/esnext.map.get-or-insert');
4
- var entryUnbind = require('../../internals/entry-unbind');
2
+ var parent = require('../../actual/map/get-or-insert');
5
3
 
6
- module.exports = entryUnbind('Map', 'getOrInsert');
4
+ module.exports = parent;
@@ -1,6 +1,4 @@
1
1
  'use strict';
2
- require('../../modules/es.weak-map');
3
- require('../../modules/esnext.weak-map.get-or-insert-computed');
4
- var entryUnbind = require('../../internals/entry-unbind');
2
+ var parent = require('../../actual/weak-map/get-or-insert-computed');
5
3
 
6
- module.exports = entryUnbind('WeakMap', 'getOrInsertComputed');
4
+ module.exports = parent;
@@ -1,6 +1,4 @@
1
1
  'use strict';
2
- require('../../modules/es.weak-map');
3
- require('../../modules/esnext.weak-map.get-or-insert');
4
- var entryUnbind = require('../../internals/entry-unbind');
2
+ var parent = require('../../actual/weak-map/get-or-insert');
5
3
 
6
- module.exports = entryUnbind('WeakMap', 'getOrInsert');
4
+ module.exports = parent;
@@ -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.44.0',
10
+ version: '3.45.0',
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.44.0/LICENSE',
13
+ license: 'https://github.com/zloirock/core-js/blob/v3.45.0/LICENSE',
14
14
  source: 'https://github.com/zloirock/core-js'
15
15
  });
@@ -81,6 +81,7 @@ module.exports = function (string, options, into, maxLength) {
81
81
 
82
82
  if (into) notDetached(into.buffer);
83
83
 
84
+ var stringLength = string.length;
84
85
  var bytes = into || [];
85
86
  var written = 0;
86
87
  var read = 0;
@@ -89,7 +90,7 @@ module.exports = function (string, options, into, maxLength) {
89
90
 
90
91
  if (maxLength) while (true) {
91
92
  index = skipAsciiWhitespace(string, index);
92
- if (index === string.length) {
93
+ if (index === stringLength) {
93
94
  if (chunk.length > 0) {
94
95
  if (lastChunkHandling === 'stop-before-partial') {
95
96
  break;
@@ -103,7 +104,7 @@ module.exports = function (string, options, into, maxLength) {
103
104
  throw new SyntaxError('Missing padding');
104
105
  }
105
106
  }
106
- read = string.length;
107
+ read = stringLength;
107
108
  break;
108
109
  }
109
110
  var chr = at(string, index);
@@ -114,7 +115,7 @@ module.exports = function (string, options, into, maxLength) {
114
115
  }
115
116
  index = skipAsciiWhitespace(string, index);
116
117
  if (chunk.length === 2) {
117
- if (index === string.length) {
118
+ if (index === stringLength) {
118
119
  if (lastChunkHandling === 'stop-before-partial') {
119
120
  break;
120
121
  }
@@ -125,11 +126,11 @@ module.exports = function (string, options, into, maxLength) {
125
126
  index = skipAsciiWhitespace(string, index);
126
127
  }
127
128
  }
128
- if (index < string.length) {
129
+ if (index < stringLength) {
129
130
  throw new SyntaxError('Unexpected character after padding');
130
131
  }
131
132
  written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, lastChunkHandling === 'strict'), written);
132
- read = string.length;
133
+ read = stringLength;
133
134
  break;
134
135
  }
135
136
  if (!hasOwn(alphabet, chr)) {
@@ -0,0 +1,151 @@
1
+ 'use strict';
2
+ // based on Shewchuk's algorithm for exactly floating point addition
3
+ // adapted from https://github.com/tc39/proposal-math-sum/blob/3513d58323a1ae25560e8700aa5294500c6c9287/polyfill/polyfill.mjs
4
+ var $ = require('../internals/export');
5
+ var uncurryThis = require('../internals/function-uncurry-this');
6
+ var iterate = require('../internals/iterate');
7
+
8
+ var $RangeError = RangeError;
9
+ var $TypeError = TypeError;
10
+ var $Infinity = Infinity;
11
+ var $NaN = NaN;
12
+ var abs = Math.abs;
13
+ var pow = Math.pow;
14
+ var push = uncurryThis([].push);
15
+
16
+ var POW_2_1023 = pow(2, 1023);
17
+ var MAX_SAFE_INTEGER = pow(2, 53) - 1; // 2 ** 53 - 1 === 9007199254740992
18
+ var MAX_DOUBLE = Number.MAX_VALUE; // 2 ** 1024 - 2 ** (1023 - 52) === 1.79769313486231570815e+308
19
+ var MAX_ULP = pow(2, 971); // 2 ** (1023 - 52) === 1.99584030953471981166e+292
20
+
21
+ var NOT_A_NUMBER = {};
22
+ var MINUS_INFINITY = {};
23
+ var PLUS_INFINITY = {};
24
+ var MINUS_ZERO = {};
25
+ var FINITE = {};
26
+
27
+ // prerequisite: abs(x) >= abs(y)
28
+ var twosum = function (x, y) {
29
+ var hi = x + y;
30
+ var lo = y - (hi - x);
31
+ return { hi: hi, lo: lo };
32
+ };
33
+
34
+ // `Math.sumPrecise` method
35
+ // https://github.com/tc39/proposal-math-sum
36
+ $({ target: 'Math', stat: true }, {
37
+ // eslint-disable-next-line max-statements -- ok
38
+ sumPrecise: function sumPrecise(items) {
39
+ var numbers = [];
40
+ var count = 0;
41
+ var state = MINUS_ZERO;
42
+
43
+ iterate(items, function (n) {
44
+ if (++count >= MAX_SAFE_INTEGER) throw new $RangeError('Maximum allowed index exceeded');
45
+ if (typeof n != 'number') throw new $TypeError('Value is not a number');
46
+ if (state !== NOT_A_NUMBER) {
47
+ // eslint-disable-next-line no-self-compare -- NaN check
48
+ if (n !== n) state = NOT_A_NUMBER;
49
+ else if (n === $Infinity) state = state === MINUS_INFINITY ? NOT_A_NUMBER : PLUS_INFINITY;
50
+ else if (n === -$Infinity) state = state === PLUS_INFINITY ? NOT_A_NUMBER : MINUS_INFINITY;
51
+ else if ((n !== 0 || (1 / n) === $Infinity) && (state === MINUS_ZERO || state === FINITE)) {
52
+ state = FINITE;
53
+ push(numbers, n);
54
+ }
55
+ }
56
+ });
57
+
58
+ switch (state) {
59
+ case NOT_A_NUMBER: return $NaN;
60
+ case MINUS_INFINITY: return -$Infinity;
61
+ case PLUS_INFINITY: return $Infinity;
62
+ case MINUS_ZERO: return -0;
63
+ }
64
+
65
+ var partials = [];
66
+ var overflow = 0; // conceptually 2 ** 1024 times this value; the final partial is biased by this amount
67
+ var x, y, sum, hi, lo, tmp;
68
+
69
+ for (var i = 0; i < numbers.length; i++) {
70
+ x = numbers[i];
71
+ var actuallyUsedPartials = 0;
72
+ for (var j = 0; j < partials.length; j++) {
73
+ y = partials[j];
74
+ if (abs(x) < abs(y)) {
75
+ tmp = x;
76
+ x = y;
77
+ y = tmp;
78
+ }
79
+ sum = twosum(x, y);
80
+ hi = sum.hi;
81
+ lo = sum.lo;
82
+ if (abs(hi) === $Infinity) {
83
+ var sign = hi === $Infinity ? 1 : -1;
84
+ overflow += sign;
85
+
86
+ x = (x - (sign * POW_2_1023)) - (sign * POW_2_1023);
87
+ if (abs(x) < abs(y)) {
88
+ tmp = x;
89
+ x = y;
90
+ y = tmp;
91
+ }
92
+ sum = twosum(x, y);
93
+ hi = sum.hi;
94
+ lo = sum.lo;
95
+ }
96
+ if (lo !== 0) partials[actuallyUsedPartials++] = lo;
97
+ x = hi;
98
+ }
99
+ partials.length = actuallyUsedPartials;
100
+ if (x !== 0) push(partials, x);
101
+ }
102
+
103
+ // compute the exact sum of partials, stopping once we lose precision
104
+ var n = partials.length - 1;
105
+ hi = 0;
106
+ lo = 0;
107
+
108
+ if (overflow !== 0) {
109
+ var next = n >= 0 ? partials[n] : 0;
110
+ n--;
111
+ if (abs(overflow) > 1 || (overflow > 0 && next > 0) || (overflow < 0 && next < 0)) {
112
+ return overflow > 0 ? $Infinity : -$Infinity;
113
+ }
114
+ // here we actually have to do the arithmetic
115
+ // drop a factor of 2 so we can do it without overflow
116
+ // assert(abs(overflow) === 1)
117
+ sum = twosum(overflow * POW_2_1023, next / 2);
118
+ hi = sum.hi;
119
+ lo = sum.lo;
120
+ lo *= 2;
121
+ if (abs(2 * hi) === $Infinity) {
122
+ // rounding to the maximum value
123
+ if (hi > 0) {
124
+ return (hi === POW_2_1023 && lo === -(MAX_ULP / 2) && n >= 0 && partials[n] < 0) ? MAX_DOUBLE : $Infinity;
125
+ } return (hi === -POW_2_1023 && lo === (MAX_ULP / 2) && n >= 0 && partials[n] > 0) ? -MAX_DOUBLE : -$Infinity;
126
+ }
127
+
128
+ if (lo !== 0) {
129
+ partials[++n] = lo;
130
+ lo = 0;
131
+ }
132
+
133
+ hi *= 2;
134
+ }
135
+
136
+ while (n >= 0) {
137
+ sum = twosum(hi, partials[n--]);
138
+ hi = sum.hi;
139
+ lo = sum.lo;
140
+ if (lo !== 0) break;
141
+ }
142
+
143
+ if (n >= 0 && ((lo < 0 && partials[n] < 0) || (lo > 0 && partials[n] > 0))) {
144
+ y = lo * 2;
145
+ x = hi + y;
146
+ if (y === x - hi) hi = x;
147
+ }
148
+
149
+ return hi;
150
+ }
151
+ });
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -35,7 +35,7 @@ var IteratorProxy = createIteratorProxy(function () {
35
35
 
36
36
  // `Iterator.concat` method
37
37
  // https://github.com/tc39/proposal-iterator-sequencing
38
- $({ target: 'Iterator', stat: true, forced: true }, {
38
+ $({ target: 'Iterator', stat: true }, {
39
39
  concat: function concat() {
40
40
  var length = arguments.length;
41
41
  var iterables = $Array(length);
@@ -10,7 +10,7 @@ var set = MapHelpers.set;
10
10
 
11
11
  // `Map.prototype.getOrInsertComputed` method
12
12
  // https://github.com/tc39/proposal-upsert
13
- $({ target: 'Map', proto: true, real: true, forced: true }, {
13
+ $({ target: 'Map', proto: true, real: true }, {
14
14
  getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
15
15
  aMap(this);
16
16
  aCallable(callbackfn);
@@ -9,7 +9,7 @@ var set = MapHelpers.set;
9
9
 
10
10
  // `Map.prototype.getOrInsert` method
11
11
  // https://github.com/tc39/proposal-upsert
12
- $({ target: 'Map', proto: true, real: true, forced: true }, {
12
+ $({ target: 'Map', proto: true, real: true }, {
13
13
  getOrInsert: function getOrInsert(key, value) {
14
14
  if (has(aMap(this), key)) return get(this, key);
15
15
  set(this, key, value);
@@ -1,151 +1,3 @@
1
1
  'use strict';
2
- // based on Shewchuk's algorithm for exactly floating point addition
3
- // adapted from https://github.com/tc39/proposal-math-sum/blob/3513d58323a1ae25560e8700aa5294500c6c9287/polyfill/polyfill.mjs
4
- var $ = require('../internals/export');
5
- var uncurryThis = require('../internals/function-uncurry-this');
6
- var iterate = require('../internals/iterate');
7
-
8
- var $RangeError = RangeError;
9
- var $TypeError = TypeError;
10
- var $Infinity = Infinity;
11
- var $NaN = NaN;
12
- var abs = Math.abs;
13
- var pow = Math.pow;
14
- var push = uncurryThis([].push);
15
-
16
- var POW_2_1023 = pow(2, 1023);
17
- var MAX_SAFE_INTEGER = pow(2, 53) - 1; // 2 ** 53 - 1 === 9007199254740992
18
- var MAX_DOUBLE = Number.MAX_VALUE; // 2 ** 1024 - 2 ** (1023 - 52) === 1.79769313486231570815e+308
19
- var MAX_ULP = pow(2, 971); // 2 ** (1023 - 52) === 1.99584030953471981166e+292
20
-
21
- var NOT_A_NUMBER = {};
22
- var MINUS_INFINITY = {};
23
- var PLUS_INFINITY = {};
24
- var MINUS_ZERO = {};
25
- var FINITE = {};
26
-
27
- // prerequisite: abs(x) >= abs(y)
28
- var twosum = function (x, y) {
29
- var hi = x + y;
30
- var lo = y - (hi - x);
31
- return { hi: hi, lo: lo };
32
- };
33
-
34
- // `Math.sumPrecise` method
35
- // https://github.com/tc39/proposal-math-sum
36
- $({ target: 'Math', stat: true }, {
37
- // eslint-disable-next-line max-statements -- ok
38
- sumPrecise: function sumPrecise(items) {
39
- var numbers = [];
40
- var count = 0;
41
- var state = MINUS_ZERO;
42
-
43
- iterate(items, function (n) {
44
- if (++count >= MAX_SAFE_INTEGER) throw new $RangeError('Maximum allowed index exceeded');
45
- if (typeof n != 'number') throw new $TypeError('Value is not a number');
46
- if (state !== NOT_A_NUMBER) {
47
- // eslint-disable-next-line no-self-compare -- NaN check
48
- if (n !== n) state = NOT_A_NUMBER;
49
- else if (n === $Infinity) state = state === MINUS_INFINITY ? NOT_A_NUMBER : PLUS_INFINITY;
50
- else if (n === -$Infinity) state = state === PLUS_INFINITY ? NOT_A_NUMBER : MINUS_INFINITY;
51
- else if ((n !== 0 || (1 / n) === $Infinity) && (state === MINUS_ZERO || state === FINITE)) {
52
- state = FINITE;
53
- push(numbers, n);
54
- }
55
- }
56
- });
57
-
58
- switch (state) {
59
- case NOT_A_NUMBER: return $NaN;
60
- case MINUS_INFINITY: return -$Infinity;
61
- case PLUS_INFINITY: return $Infinity;
62
- case MINUS_ZERO: return -0;
63
- }
64
-
65
- var partials = [];
66
- var overflow = 0; // conceptually 2 ** 1024 times this value; the final partial is biased by this amount
67
- var x, y, sum, hi, lo, tmp;
68
-
69
- for (var i = 0; i < numbers.length; i++) {
70
- x = numbers[i];
71
- var actuallyUsedPartials = 0;
72
- for (var j = 0; j < partials.length; j++) {
73
- y = partials[j];
74
- if (abs(x) < abs(y)) {
75
- tmp = x;
76
- x = y;
77
- y = tmp;
78
- }
79
- sum = twosum(x, y);
80
- hi = sum.hi;
81
- lo = sum.lo;
82
- if (abs(hi) === $Infinity) {
83
- var sign = hi === $Infinity ? 1 : -1;
84
- overflow += sign;
85
-
86
- x = (x - (sign * POW_2_1023)) - (sign * POW_2_1023);
87
- if (abs(x) < abs(y)) {
88
- tmp = x;
89
- x = y;
90
- y = tmp;
91
- }
92
- sum = twosum(x, y);
93
- hi = sum.hi;
94
- lo = sum.lo;
95
- }
96
- if (lo !== 0) partials[actuallyUsedPartials++] = lo;
97
- x = hi;
98
- }
99
- partials.length = actuallyUsedPartials;
100
- if (x !== 0) push(partials, x);
101
- }
102
-
103
- // compute the exact sum of partials, stopping once we lose precision
104
- var n = partials.length - 1;
105
- hi = 0;
106
- lo = 0;
107
-
108
- if (overflow !== 0) {
109
- var next = n >= 0 ? partials[n] : 0;
110
- n--;
111
- if (abs(overflow) > 1 || (overflow > 0 && next > 0) || (overflow < 0 && next < 0)) {
112
- return overflow > 0 ? $Infinity : -$Infinity;
113
- }
114
- // here we actually have to do the arithmetic
115
- // drop a factor of 2 so we can do it without overflow
116
- // assert(abs(overflow) === 1)
117
- sum = twosum(overflow * POW_2_1023, next / 2);
118
- hi = sum.hi;
119
- lo = sum.lo;
120
- lo *= 2;
121
- if (abs(2 * hi) === $Infinity) {
122
- // rounding to the maximum value
123
- if (hi > 0) {
124
- return (hi === POW_2_1023 && lo === -(MAX_ULP / 2) && n >= 0 && partials[n] < 0) ? MAX_DOUBLE : $Infinity;
125
- } return (hi === -POW_2_1023 && lo === (MAX_ULP / 2) && n >= 0 && partials[n] > 0) ? -MAX_DOUBLE : -$Infinity;
126
- }
127
-
128
- if (lo !== 0) {
129
- partials[++n] = lo;
130
- lo = 0;
131
- }
132
-
133
- hi *= 2;
134
- }
135
-
136
- while (n >= 0) {
137
- sum = twosum(hi, partials[n--]);
138
- hi = sum.hi;
139
- lo = sum.lo;
140
- if (lo !== 0) break;
141
- }
142
-
143
- if (n >= 0 && ((lo < 0 && partials[n] < 0) || (lo > 0 && partials[n] > 0))) {
144
- y = lo * 2;
145
- x = hi + y;
146
- if (y === x - hi) hi = x;
147
- }
148
-
149
- return hi;
150
- }
151
- });
2
+ // TODO: Remove from `core-js@4`
3
+ require('../modules/es.math.sum-precise');
@@ -11,7 +11,7 @@ var set = WeakMapHelpers.set;
11
11
 
12
12
  // `WeakMap.prototype.getOrInsertComputed` method
13
13
  // https://github.com/tc39/proposal-upsert
14
- $({ target: 'WeakMap', proto: true, real: true, forced: true }, {
14
+ $({ target: 'WeakMap', proto: true, real: true }, {
15
15
  getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
16
16
  aWeakMap(this);
17
17
  aWeakKey(key);
@@ -9,7 +9,7 @@ var set = WeakMapHelpers.set;
9
9
 
10
10
  // `WeakMap.prototype.getOrInsert` method
11
11
  // https://github.com/tc39/proposal-upsert
12
- $({ target: 'WeakMap', proto: true, real: true, forced: true }, {
12
+ $({ target: 'WeakMap', proto: true, real: true }, {
13
13
  getOrInsert: function getOrInsert(key, value) {
14
14
  if (has(aWeakMap(this), key)) return get(this, key);
15
15
  set(this, key, value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
- "version": "3.44.0",
3
+ "version": "3.45.0",
4
4
  "type": "commonjs",
5
5
  "description": "Standard library",
6
6
  "keywords": [
package/stable/index.js CHANGED
@@ -117,6 +117,7 @@ require('../modules/es.math.log1p');
117
117
  require('../modules/es.math.log2');
118
118
  require('../modules/es.math.sign');
119
119
  require('../modules/es.math.sinh');
120
+ require('../modules/es.math.sum-precise');
120
121
  require('../modules/es.math.tanh');
121
122
  require('../modules/es.math.to-string-tag');
122
123
  require('../modules/es.math.trunc');
@@ -278,6 +279,12 @@ require('../modules/es.typed-array.to-reversed');
278
279
  require('../modules/es.typed-array.to-sorted');
279
280
  require('../modules/es.typed-array.to-string');
280
281
  require('../modules/es.typed-array.with');
282
+ require('../modules/es.uint8-array.from-base64');
283
+ require('../modules/es.uint8-array.from-hex');
284
+ require('../modules/es.uint8-array.set-from-base64');
285
+ require('../modules/es.uint8-array.set-from-hex');
286
+ require('../modules/es.uint8-array.to-base64');
287
+ require('../modules/es.uint8-array.to-hex');
281
288
  require('../modules/es.unescape');
282
289
  require('../modules/es.weak-map');
283
290
  require('../modules/es.weak-set');
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/math/sum-precise');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/typed-array/from-base64');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/typed-array/from-hex');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/typed-array/set-from-base64');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/typed-array/set-from-hex');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/typed-array/to-base64');
3
+
4
+ module.exports = parent;
@@ -0,0 +1,4 @@
1
+ 'use strict';
2
+ var parent = require('../../es/typed-array/to-hex');
3
+
4
+ module.exports = parent;
package/stage/2.7.js CHANGED
@@ -1,7 +1,6 @@
1
1
  'use strict';
2
2
  var parent = require('./3');
3
3
 
4
- require('../proposals/iterator-sequencing');
5
- require('../proposals/map-upsert-v4');
4
+ require('../proposals/joint-iteration');
6
5
 
7
6
  module.exports = parent;
package/stage/2.js CHANGED
@@ -14,7 +14,6 @@ require('../proposals/async-explicit-resource-management');
14
14
  require('../proposals/decorators');
15
15
  require('../proposals/decorator-metadata');
16
16
  require('../proposals/iterator-helpers');
17
- require('../proposals/joint-iteration');
18
17
  require('../proposals/map-upsert-stage-2');
19
18
  require('../proposals/math-clamp-v2');
20
19
  require('../proposals/set-methods');
package/stage/3.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
  var parent = require('./4');
3
3
 
4
- require('../proposals/array-buffer-base64');
5
4
  require('../proposals/decorator-metadata-v2');
5
+ require('../proposals/iterator-sequencing');
6
6
  require('../proposals/json-parse-with-source');
7
- require('../proposals/math-sum');
7
+ require('../proposals/map-upsert-v4');
8
8
  // TODO: Obsolete versions, remove from `core-js@4`
9
9
  require('../proposals/array-grouping-stage-3');
10
10
  require('../proposals/array-grouping-stage-3-2');
package/stage/4.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
  // TODO: Remove this entry from `core-js@4`
3
3
  require('../proposals/accessible-object-hasownproperty');
4
+ require('../proposals/array-buffer-base64');
4
5
  require('../proposals/array-buffer-transfer');
5
6
  require('../proposals/array-find-from-last');
6
7
  require('../proposals/array-from-async-stage-2');
@@ -12,6 +13,7 @@ require('../proposals/float16');
12
13
  require('../proposals/global-this');
13
14
  require('../proposals/is-error');
14
15
  require('../proposals/iterator-helpers-stage-3-2');
16
+ require('../proposals/math-sum');
15
17
  require('../proposals/promise-all-settled');
16
18
  require('../proposals/promise-any');
17
19
  require('../proposals/promise-try');