core-js 3.37.1 → 3.38.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/actual/promise/index.js +1 -0
  2. package/actual/promise/try.js +13 -0
  3. package/actual/regexp/escape.js +5 -0
  4. package/actual/regexp/index.js +1 -0
  5. package/actual/typed-array/index.js +2 -0
  6. package/actual/typed-array/methods.js +2 -0
  7. package/actual/typed-array/set-from-base64.js +2 -0
  8. package/actual/typed-array/set-from-hex.js +2 -0
  9. package/es/global-this.js +1 -1
  10. package/es/typed-array/float32-array.js +1 -1
  11. package/es/typed-array/float64-array.js +1 -1
  12. package/es/typed-array/index.js +1 -1
  13. package/es/typed-array/int16-array.js +1 -1
  14. package/es/typed-array/int32-array.js +1 -1
  15. package/es/typed-array/int8-array.js +1 -1
  16. package/es/typed-array/uint16-array.js +1 -1
  17. package/es/typed-array/uint32-array.js +1 -1
  18. package/es/typed-array/uint8-array.js +1 -1
  19. package/es/typed-array/uint8-clamped-array.js +1 -1
  20. package/features/typed-array/set-from-base64.js +2 -0
  21. package/features/typed-array/set-from-hex.js +2 -0
  22. package/full/index.js +2 -0
  23. package/full/promise/index.js +0 -1
  24. package/full/promise/try.js +2 -11
  25. package/full/regexp/escape.js +2 -3
  26. package/full/regexp/index.js +0 -1
  27. package/full/typed-array/set-from-base64.js +4 -0
  28. package/full/typed-array/set-from-hex.js +4 -0
  29. package/internals/array-buffer-byte-length.js +5 -3
  30. package/internals/array-buffer-is-detached.js +6 -2
  31. package/internals/array-buffer-not-detached.js +9 -0
  32. package/internals/array-buffer-transfer.js +6 -7
  33. package/internals/array-buffer-view-core.js +14 -14
  34. package/internals/array-buffer.js +7 -7
  35. package/internals/array-method-has-species-support.js +1 -1
  36. package/internals/async-iterator-prototype.js +3 -3
  37. package/internals/collection-strong.js +7 -7
  38. package/internals/collection-weak.js +2 -2
  39. package/internals/collection.js +2 -2
  40. package/internals/define-global-property.js +3 -3
  41. package/internals/detach-transferable.js +6 -6
  42. package/internals/document-create-element.js +2 -2
  43. package/internals/entry-unbind.js +2 -2
  44. package/internals/entry-virtual.js +2 -2
  45. package/internals/{engine-ff-version.js → environment-ff-version.js} +1 -1
  46. package/internals/{engine-is-ie-or-edge.js → environment-is-ie-or-edge.js} +1 -1
  47. package/internals/{engine-is-ios-pebble.js → environment-is-ios-pebble.js} +1 -1
  48. package/internals/{engine-is-ios.js → environment-is-ios.js} +1 -1
  49. package/internals/environment-is-node.js +4 -0
  50. package/internals/{engine-is-webos-webkit.js → environment-is-webos-webkit.js} +1 -1
  51. package/internals/environment-user-agent.js +7 -0
  52. package/internals/{engine-v8-version.js → environment-v8-version.js} +4 -4
  53. package/internals/{engine-webkit-version.js → environment-webkit-version.js} +1 -1
  54. package/internals/environment.js +21 -0
  55. package/internals/export.js +4 -4
  56. package/internals/get-built-in-node-module.js +15 -0
  57. package/internals/get-built-in-prototype-method.js +2 -2
  58. package/internals/get-built-in.js +2 -2
  59. package/internals/ieee754.js +1 -1
  60. package/internals/internal-state.js +3 -3
  61. package/internals/microtask.js +10 -10
  62. package/internals/number-is-finite.js +2 -2
  63. package/internals/number-parse-float.js +3 -3
  64. package/internals/number-parse-int.js +3 -3
  65. package/internals/object-create.js +2 -1
  66. package/internals/object-prototype-accessors-forced.js +5 -4
  67. package/internals/path.js +2 -2
  68. package/internals/promise-constructor-detection.js +5 -6
  69. package/internals/promise-native-constructor.js +2 -2
  70. package/internals/regexp-sticky-helpers.js +2 -2
  71. package/internals/regexp-unsupported-dot-all.js +2 -2
  72. package/internals/regexp-unsupported-ncg.js +2 -2
  73. package/internals/safe-get-built-in.js +3 -3
  74. package/internals/schedulers-fix.js +6 -6
  75. package/internals/shared-store.js +3 -3
  76. package/internals/string-pad-webkit-bug.js +1 -1
  77. package/internals/structured-clone-proper-transfer.js +5 -7
  78. package/internals/symbol-constructor-detection.js +3 -3
  79. package/internals/task.js +16 -16
  80. package/internals/typed-array-constructor.js +3 -3
  81. package/internals/typed-array-constructors-require-wrappers.js +4 -4
  82. package/internals/uint8-from-base64.js +156 -0
  83. package/internals/uint8-from-hex.js +26 -0
  84. package/internals/url-constructor-detection.js +5 -5
  85. package/internals/weak-map-basic-detection.js +2 -2
  86. package/internals/well-known-symbol.js +2 -2
  87. package/modules/es.array-buffer.constructor.js +2 -2
  88. package/modules/es.array.concat.js +1 -1
  89. package/modules/es.array.iterator.js +1 -1
  90. package/modules/es.array.reduce-right.js +2 -2
  91. package/modules/es.array.reduce.js +2 -2
  92. package/modules/es.array.sort.js +4 -4
  93. package/modules/es.error.cause.js +2 -2
  94. package/modules/es.global-this.js +3 -3
  95. package/modules/es.json.to-string-tag.js +2 -2
  96. package/modules/es.number.constructor.js +3 -3
  97. package/modules/es.number.to-exponential.js +2 -6
  98. package/modules/es.object.group-by.js +1 -1
  99. package/modules/es.promise.constructor.js +11 -11
  100. package/modules/es.reflect.to-string-tag.js +2 -2
  101. package/modules/es.regexp.constructor.js +10 -5
  102. package/modules/es.regexp.flags.js +2 -2
  103. package/modules/es.string.at-alternative.js +1 -1
  104. package/modules/es.string.replace-all.js +3 -7
  105. package/modules/es.string.to-well-formed.js +1 -1
  106. package/modules/es.symbol.constructor.js +6 -6
  107. package/modules/es.symbol.description.js +3 -2
  108. package/modules/es.typed-array.iterator.js +2 -2
  109. package/modules/es.typed-array.set.js +3 -3
  110. package/modules/es.typed-array.sort.js +6 -6
  111. package/modules/es.typed-array.to-locale-string.js +2 -2
  112. package/modules/es.typed-array.to-string.js +2 -2
  113. package/modules/es.weak-map.constructor.js +2 -2
  114. package/modules/esnext.async-disposable-stack.constructor.js +2 -2
  115. package/modules/esnext.disposable-stack.constructor.js +2 -2
  116. package/modules/esnext.iterator.constructor.js +2 -2
  117. package/modules/esnext.json.parse.js +7 -7
  118. package/modules/esnext.json.raw-json.js +5 -3
  119. package/modules/esnext.observable.constructor.js +5 -5
  120. package/modules/esnext.promise.try.js +14 -2
  121. package/modules/esnext.regexp.escape.js +56 -11
  122. package/modules/esnext.string.dedent.js +1 -0
  123. package/modules/esnext.suppressed-error.constructor.js +1 -1
  124. package/modules/esnext.symbol.async-dispose.js +2 -2
  125. package/modules/esnext.symbol.dispose.js +2 -2
  126. package/modules/esnext.uint8-array.from-base64.js +6 -65
  127. package/modules/esnext.uint8-array.from-hex.js +4 -19
  128. package/modules/esnext.uint8-array.set-from-base64.js +19 -0
  129. package/modules/esnext.uint8-array.set-from-hex.js +19 -0
  130. package/modules/esnext.uint8-array.to-base64.js +7 -5
  131. package/modules/esnext.uint8-array.to-hex.js +4 -3
  132. package/modules/web.atob.js +2 -2
  133. package/modules/web.btoa.js +2 -2
  134. package/modules/web.clear-immediate.js +2 -2
  135. package/modules/web.dom-collections.for-each.js +2 -2
  136. package/modules/web.dom-collections.iterator.js +2 -2
  137. package/modules/web.dom-exception.constructor.js +2 -2
  138. package/modules/web.dom-exception.stack.js +2 -2
  139. package/modules/web.queue-microtask.js +1 -1
  140. package/modules/web.self.js +8 -8
  141. package/modules/web.set-immediate.js +3 -3
  142. package/modules/web.set-interval.js +3 -3
  143. package/modules/web.set-timeout.js +3 -3
  144. package/modules/web.structured-clone.js +18 -18
  145. package/modules/web.url-search-params.constructor.js +120 -25
  146. package/modules/web.url.constructor.js +14 -12
  147. package/package.json +4 -2
  148. package/proposals/array-buffer-base64.js +2 -0
  149. package/proposals/global-this.js +2 -2
  150. package/stage/2.7.js +0 -1
  151. package/stage/2.js +0 -1
  152. package/stage/3.js +2 -0
  153. package/internals/engine-is-browser.js +0 -7
  154. package/internals/engine-is-bun.js +0 -3
  155. package/internals/engine-is-deno.js +0 -3
  156. package/internals/engine-is-node.js +0 -5
  157. package/internals/engine-user-agent.js +0 -2
  158. package/internals/try-node-require.js +0 -9
  159. /package/internals/{global.js → global-this.js} +0 -0
@@ -4,7 +4,7 @@ require('../modules/es.string.iterator');
4
4
  var $ = require('../internals/export');
5
5
  var DESCRIPTORS = require('../internals/descriptors');
6
6
  var USE_NATIVE_URL = require('../internals/url-constructor-detection');
7
- var global = require('../internals/global');
7
+ var globalThis = require('../internals/global-this');
8
8
  var bind = require('../internals/function-bind-context');
9
9
  var uncurryThis = require('../internals/function-uncurry-this');
10
10
  var defineBuiltIn = require('../internals/define-built-in');
@@ -27,9 +27,9 @@ var getInternalURLState = InternalStateModule.getterFor('URL');
27
27
  var URLSearchParams = URLSearchParamsModule.URLSearchParams;
28
28
  var getInternalSearchParamsState = URLSearchParamsModule.getState;
29
29
 
30
- var NativeURL = global.URL;
31
- var TypeError = global.TypeError;
32
- var parseInt = global.parseInt;
30
+ var NativeURL = globalThis.URL;
31
+ var TypeError = globalThis.TypeError;
32
+ var parseInt = globalThis.parseInt;
33
33
  var floor = Math.floor;
34
34
  var pow = Math.pow;
35
35
  var charAt = uncurryThis(''.charAt);
@@ -203,25 +203,25 @@ var findLongestZeroSequence = function (ipv6) {
203
203
  ++currLength;
204
204
  }
205
205
  }
206
- if (currLength > maxLength) {
207
- maxIndex = currStart;
208
- maxLength = currLength;
209
- }
210
- return maxIndex;
206
+ return currLength > maxLength ? currStart : maxIndex;
211
207
  };
212
208
 
213
209
  // https://url.spec.whatwg.org/#host-serializing
214
210
  var serializeHost = function (host) {
215
211
  var result, index, compress, ignore0;
212
+
216
213
  // ipv4
217
214
  if (typeof host == 'number') {
218
215
  result = [];
219
216
  for (index = 0; index < 4; index++) {
220
217
  unshift(result, host % 256);
221
218
  host = floor(host / 256);
222
- } return join(result, '.');
219
+ }
220
+ return join(result, '.');
221
+ }
222
+
223
223
  // ipv6
224
- } else if (typeof host == 'object') {
224
+ if (typeof host == 'object') {
225
225
  result = '';
226
226
  compress = findLongestZeroSequence(host);
227
227
  for (index = 0; index < 8; index++) {
@@ -236,7 +236,9 @@ var serializeHost = function (host) {
236
236
  }
237
237
  }
238
238
  return '[' + result + ']';
239
- } return host;
239
+ }
240
+
241
+ return host;
240
242
  };
241
243
 
242
244
  var C0ControlPercentEncodeSet = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-js",
3
- "version": "3.37.1",
3
+ "version": "3.38.1",
4
4
  "type": "commonjs",
5
5
  "description": "Standard library",
6
6
  "keywords": [
@@ -17,6 +17,7 @@
17
17
  "ES2021",
18
18
  "ES2022",
19
19
  "ES2023",
20
+ "ES2024",
20
21
  "ECMAScript 3",
21
22
  "ECMAScript 5",
22
23
  "ECMAScript 6",
@@ -30,6 +31,7 @@
30
31
  "ECMAScript 2021",
31
32
  "ECMAScript 2022",
32
33
  "ECMAScript 2023",
34
+ "ECMAScript 2024",
33
35
  "Map",
34
36
  "Set",
35
37
  "WeakMap",
@@ -51,7 +53,7 @@
51
53
  ],
52
54
  "repository": {
53
55
  "type": "git",
54
- "url": "https://github.com/zloirock/core-js.git",
56
+ "url": "git+https://github.com/zloirock/core-js.git",
55
57
  "directory": "packages/core-js"
56
58
  },
57
59
  "funding": {
@@ -2,5 +2,7 @@
2
2
  // https://github.com/tc39/proposal-arraybuffer-base64
3
3
  require('../modules/esnext.uint8-array.from-base64');
4
4
  require('../modules/esnext.uint8-array.from-hex');
5
+ require('../modules/esnext.uint8-array.set-from-base64');
6
+ require('../modules/esnext.uint8-array.set-from-hex');
5
7
  require('../modules/esnext.uint8-array.to-base64');
6
8
  require('../modules/esnext.uint8-array.to-hex');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  // https://github.com/tc39/proposal-global
3
3
  require('../modules/esnext.global-this');
4
- var global = require('../internals/global');
4
+ var globalThis = require('../internals/global-this');
5
5
 
6
- module.exports = global;
6
+ module.exports = globalThis;
package/stage/2.7.js CHANGED
@@ -2,6 +2,5 @@
2
2
  var parent = require('./3');
3
3
 
4
4
  require('../proposals/math-sum');
5
- require('../proposals/promise-try');
6
5
 
7
6
  module.exports = parent;
package/stage/2.js CHANGED
@@ -5,7 +5,6 @@ require('../proposals/array-is-template-object');
5
5
  require('../proposals/async-iterator-helpers');
6
6
  require('../proposals/iterator-range');
7
7
  require('../proposals/map-upsert-stage-2');
8
- require('../proposals/regexp-escaping');
9
8
  require('../proposals/string-dedent');
10
9
  require('../proposals/symbol-predicates-v2');
11
10
  // TODO: Obsolete versions, remove from `core-js@4`
package/stage/3.js CHANGED
@@ -8,6 +8,8 @@ require('../proposals/explicit-resource-management');
8
8
  require('../proposals/float16');
9
9
  require('../proposals/iterator-helpers-stage-3-2');
10
10
  require('../proposals/json-parse-with-source');
11
+ require('../proposals/promise-try');
12
+ require('../proposals/regexp-escaping');
11
13
  // TODO: Obsolete versions, remove from `core-js@4`
12
14
  require('../proposals/array-grouping-stage-3');
13
15
  require('../proposals/array-grouping-stage-3-2');
@@ -1,7 +0,0 @@
1
- 'use strict';
2
- var IS_DENO = require('../internals/engine-is-deno');
3
- var IS_NODE = require('../internals/engine-is-node');
4
-
5
- module.exports = !IS_DENO && !IS_NODE
6
- && typeof window == 'object'
7
- && typeof document == 'object';
@@ -1,3 +0,0 @@
1
- 'use strict';
2
- /* global Bun -- Bun case */
3
- module.exports = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
@@ -1,3 +0,0 @@
1
- 'use strict';
2
- /* global Deno -- Deno case */
3
- module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
@@ -1,5 +0,0 @@
1
- 'use strict';
2
- var global = require('../internals/global');
3
- var classof = require('../internals/classof-raw');
4
-
5
- module.exports = classof(global.process) === 'process';
@@ -1,2 +0,0 @@
1
- 'use strict';
2
- module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
@@ -1,9 +0,0 @@
1
- 'use strict';
2
- var IS_NODE = require('../internals/engine-is-node');
3
-
4
- module.exports = function (name) {
5
- try {
6
- // eslint-disable-next-line no-new-func -- safe
7
- if (IS_NODE) return Function('return require("' + name + '")')();
8
- } catch (error) { /* empty */ }
9
- };
File without changes