core-js-pure
Advanced tools
Comparing version 3.22.8 to 3.23.0
require('../../modules/esnext.array.find-last-index'); | ||
var entryUnbind = require('../../internals/entry-unbind'); | ||
var parent = require('../../stable/array/find-last-index'); | ||
module.exports = entryUnbind('Array', 'findLastIndex'); | ||
module.exports = parent; |
require('../../modules/esnext.array.find-last'); | ||
var entryUnbind = require('../../internals/entry-unbind'); | ||
var parent = require('../../stable/array/find-last'); | ||
module.exports = entryUnbind('Array', 'findLast'); | ||
module.exports = parent; |
@@ -6,4 +6,6 @@ var parent = require('../../stable/array'); | ||
require('../../modules/esnext.array.find-last-index'); | ||
require('../../modules/esnext.array.group'); | ||
require('../../modules/esnext.array.group-by'); | ||
require('../../modules/esnext.array.group-by-to-map'); | ||
require('../../modules/esnext.array.group-to-map'); | ||
require('../../modules/esnext.array.to-reversed'); | ||
@@ -10,0 +12,0 @@ require('../../modules/esnext.array.to-sorted'); |
require('../../../modules/esnext.array.find-last-index'); | ||
var entryVirtual = require('../../../internals/entry-virtual'); | ||
var parent = require('../../../stable/array/virtual/find-last-index'); | ||
module.exports = entryVirtual('Array').findLastIndex; | ||
module.exports = parent; |
require('../../../modules/esnext.array.find-last'); | ||
var entryVirtual = require('../../../internals/entry-virtual'); | ||
var parent = require('../../../stable/array/virtual/find-last'); | ||
module.exports = entryVirtual('Array').findLast; | ||
module.exports = parent; |
@@ -6,4 +6,6 @@ var parent = require('../../../stable/array/virtual'); | ||
require('../../../modules/esnext.array.find-last-index'); | ||
require('../../../modules/esnext.array.group'); | ||
require('../../../modules/esnext.array.group-by'); | ||
require('../../../modules/esnext.array.group-by-to-map'); | ||
require('../../../modules/esnext.array.group-to-map'); | ||
require('../../../modules/esnext.array.to-reversed'); | ||
@@ -10,0 +12,0 @@ require('../../../modules/esnext.array.to-sorted'); |
require('../../modules/esnext.typed-array.find-last-index'); | ||
var parent = require('../../stable/typed-array/find-last-index'); | ||
module.exports = parent; |
require('../../modules/esnext.typed-array.find-last'); | ||
var parent = require('../../stable/typed-array/find-last'); | ||
module.exports = parent; |
@@ -12,2 +12,4 @@ require('../../modules/es.array.from'); | ||
require('../../modules/es.array.find-index'); | ||
require('../../modules/es.array.find-last'); | ||
require('../../modules/es.array.find-last-index'); | ||
require('../../modules/es.array.flat'); | ||
@@ -22,2 +24,3 @@ require('../../modules/es.array.flat-map'); | ||
require('../../modules/es.array.map'); | ||
require('../../modules/es.array.push'); | ||
require('../../modules/es.array.reduce'); | ||
@@ -33,2 +36,3 @@ require('../../modules/es.array.reduce-right'); | ||
require('../../modules/es.array.unscopables.flat-map'); | ||
require('../../modules/es.array.unshift'); | ||
require('../../modules/es.object.to-string'); | ||
@@ -35,0 +39,0 @@ require('../../modules/es.string.iterator'); |
@@ -9,2 +9,4 @@ require('../../../modules/es.array.at'); | ||
require('../../../modules/es.array.find-index'); | ||
require('../../../modules/es.array.find-last'); | ||
require('../../../modules/es.array.find-last-index'); | ||
require('../../../modules/es.array.flat'); | ||
@@ -19,2 +21,3 @@ require('../../../modules/es.array.flat-map'); | ||
require('../../../modules/es.array.map'); | ||
require('../../../modules/es.array.push'); | ||
require('../../../modules/es.array.reduce'); | ||
@@ -30,2 +33,3 @@ require('../../../modules/es.array.reduce-right'); | ||
require('../../../modules/es.array.unscopables.flat-map'); | ||
require('../../../modules/es.array.unshift'); | ||
require('../../../modules/es.object.to-string'); | ||
@@ -32,0 +36,0 @@ var entryVirtual = require('../../../internals/entry-virtual'); |
@@ -28,2 +28,4 @@ require('../modules/es.symbol'); | ||
require('../modules/es.array.find-index'); | ||
require('../modules/es.array.find-last'); | ||
require('../modules/es.array.find-last-index'); | ||
require('../modules/es.array.flat'); | ||
@@ -41,2 +43,3 @@ require('../modules/es.array.flat-map'); | ||
require('../modules/es.array.of'); | ||
require('../modules/es.array.push'); | ||
require('../modules/es.array.reduce'); | ||
@@ -52,2 +55,3 @@ require('../modules/es.array.reduce-right'); | ||
require('../modules/es.array.unscopables.flat-map'); | ||
require('../modules/es.array.unshift'); | ||
require('../modules/es.array-buffer.constructor'); | ||
@@ -208,2 +212,4 @@ require('../modules/es.array-buffer.is-view'); | ||
require('../modules/es.typed-array.find-index'); | ||
require('../modules/es.typed-array.find-last'); | ||
require('../modules/es.typed-array.find-last-index'); | ||
require('../modules/es.typed-array.for-each'); | ||
@@ -210,0 +216,0 @@ require('../modules/es.typed-array.from'); |
@@ -12,2 +12,4 @@ require('../../modules/es.object.to-string'); | ||
require('../../modules/es.typed-array.find-index'); | ||
require('../../modules/es.typed-array.find-last'); | ||
require('../../modules/es.typed-array.find-last-index'); | ||
require('../../modules/es.typed-array.for-each'); | ||
@@ -14,0 +16,0 @@ require('../../modules/es.typed-array.includes'); |
@@ -28,2 +28,4 @@ require('../modules/es.symbol'); | ||
require('../modules/es.array.find-index'); | ||
require('../modules/es.array.find-last'); | ||
require('../modules/es.array.find-last-index'); | ||
require('../modules/es.array.flat'); | ||
@@ -41,2 +43,3 @@ require('../modules/es.array.flat-map'); | ||
require('../modules/es.array.of'); | ||
require('../modules/es.array.push'); | ||
require('../modules/es.array.reduce'); | ||
@@ -52,2 +55,3 @@ require('../modules/es.array.reduce-right'); | ||
require('../modules/es.array.unscopables.flat-map'); | ||
require('../modules/es.array.unshift'); | ||
require('../modules/es.array-buffer.constructor'); | ||
@@ -208,2 +212,4 @@ require('../modules/es.array-buffer.is-view'); | ||
require('../modules/es.typed-array.find-index'); | ||
require('../modules/es.typed-array.find-last'); | ||
require('../modules/es.typed-array.find-last-index'); | ||
require('../modules/es.typed-array.for-each'); | ||
@@ -238,4 +244,6 @@ require('../modules/es.typed-array.from'); | ||
require('../modules/esnext.array.find-last-index'); | ||
require('../modules/esnext.array.group'); | ||
require('../modules/esnext.array.group-by'); | ||
require('../modules/esnext.array.group-by-to-map'); | ||
require('../modules/esnext.array.group-to-map'); | ||
require('../modules/esnext.array.is-template-object'); | ||
@@ -364,2 +372,3 @@ require('../modules/esnext.array.last-index'); | ||
require('../modules/esnext.symbol.metadata'); | ||
require('../modules/esnext.symbol.metadata-key'); | ||
require('../modules/esnext.symbol.observable'); | ||
@@ -366,0 +375,0 @@ require('../modules/esnext.symbol.pattern-match'); |
@@ -5,9 +5,9 @@ var parent = require('../../actual/symbol'); | ||
require('../../modules/esnext.symbol.matcher'); | ||
require('../../modules/esnext.symbol.metadata'); | ||
require('../../modules/esnext.symbol.metadata-key'); | ||
require('../../modules/esnext.symbol.observable'); | ||
// TODO: Remove from `core-js@4` | ||
require('../../modules/esnext.symbol.metadata'); | ||
require('../../modules/esnext.symbol.pattern-match'); | ||
// TODO: Remove from `core-js@4` | ||
require('../../modules/esnext.symbol.replace-all'); | ||
module.exports = parent; |
@@ -7,7 +7,7 @@ var IS_PURE = require('../internals/is-pure'); | ||
})('versions', []).push({ | ||
version: '3.22.8', | ||
version: '3.23.0', | ||
mode: IS_PURE ? 'pure' : 'global', | ||
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.22.8/LICENSE', | ||
license: 'https://github.com/zloirock/core-js/blob/v3.23.0/LICENSE', | ||
source: 'https://github.com/zloirock/core-js' | ||
}); |
@@ -5,4 +5,4 @@ var $ = require('../internals/export'); | ||
// https://tc39.es/ecma262/#sec-number.epsilon | ||
$({ target: 'Number', stat: true }, { | ||
$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { | ||
EPSILON: Math.pow(2, -52) | ||
}); |
@@ -5,4 +5,4 @@ var $ = require('../internals/export'); | ||
// https://tc39.es/ecma262/#sec-number.max_safe_integer | ||
$({ target: 'Number', stat: true }, { | ||
$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { | ||
MAX_SAFE_INTEGER: 0x1FFFFFFFFFFFFF | ||
}); |
@@ -5,4 +5,4 @@ var $ = require('../internals/export'); | ||
// https://tc39.es/ecma262/#sec-number.min_safe_integer | ||
$({ target: 'Number', stat: true }, { | ||
$({ target: 'Number', stat: true, nonConfigurable: true, nonWritable: true }, { | ||
MIN_SAFE_INTEGER: -0x1FFFFFFFFFFFFF | ||
}); |
@@ -1,14 +0,2 @@ | ||
'use strict'; | ||
var $ = require('../internals/export'); | ||
var $findLastIndex = require('../internals/array-iteration-from-last').findLastIndex; | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
// `Array.prototype.findLastIndex` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
$({ target: 'Array', proto: true }, { | ||
findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { | ||
return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} | ||
}); | ||
addToUnscopables('findLastIndex'); | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/es.array.find-last-index'); |
@@ -1,14 +0,2 @@ | ||
'use strict'; | ||
var $ = require('../internals/export'); | ||
var $findLast = require('../internals/array-iteration-from-last').findLast; | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
// `Array.prototype.findLast` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
$({ target: 'Array', proto: true }, { | ||
findLast: function findLast(callbackfn /* , that = undefined */) { | ||
return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} | ||
}); | ||
addToUnscopables('findLast'); | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/es.array.find-last'); |
@@ -1,40 +0,14 @@ | ||
'use strict'; | ||
// TODO: Remove from `core-js@4` | ||
var $ = require('../internals/export'); | ||
var getBuiltIn = require('../internals/get-built-in'); | ||
var bind = require('../internals/function-bind-context'); | ||
var uncurryThis = require('../internals/function-uncurry-this'); | ||
var IndexedObject = require('../internals/indexed-object'); | ||
var toObject = require('../internals/to-object'); | ||
var lengthOfArrayLike = require('../internals/length-of-array-like'); | ||
var arrayMethodIsStrict = require('../internals/array-method-is-strict'); | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
var $groupToMap = require('../internals/array-group-to-map'); | ||
var Map = getBuiltIn('Map'); | ||
var MapPrototype = Map.prototype; | ||
var mapGet = uncurryThis(MapPrototype.get); | ||
var mapHas = uncurryThis(MapPrototype.has); | ||
var mapSet = uncurryThis(MapPrototype.set); | ||
var push = uncurryThis([].push); | ||
// `Array.prototype.groupByToMap` method | ||
// https://github.com/tc39/proposal-array-grouping | ||
// https://bugs.webkit.org/show_bug.cgi?id=236541 | ||
$({ target: 'Array', proto: true, forced: !arrayMethodIsStrict('groupByToMap') }, { | ||
groupByToMap: function groupByToMap(callbackfn /* , thisArg */) { | ||
var O = toObject(this); | ||
var self = IndexedObject(O); | ||
var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
var map = new Map(); | ||
var length = lengthOfArrayLike(self); | ||
var index = 0; | ||
var key, value; | ||
for (;length > index; index++) { | ||
value = self[index]; | ||
key = boundFunction(value, index, O); | ||
if (mapHas(map, key)) push(mapGet(map, key), value); | ||
else mapSet(map, key, [value]); | ||
} return map; | ||
} | ||
$({ target: 'Array', proto: true, name: 'groupToMap', forced: !arrayMethodIsStrict('groupByToMap') }, { | ||
groupByToMap: $groupToMap | ||
}); | ||
addToUnscopables('groupByToMap'); |
'use strict'; | ||
// TODO: Remove from `core-js@4` | ||
var $ = require('../internals/export'); | ||
var $groupBy = require('../internals/array-group-by'); | ||
var $group = require('../internals/array-group'); | ||
var arrayMethodIsStrict = require('../internals/array-method-is-strict'); | ||
@@ -13,3 +14,3 @@ var addToUnscopables = require('../internals/add-to-unscopables'); | ||
var thisArg = arguments.length > 1 ? arguments[1] : undefined; | ||
return $groupBy(this, callbackfn, thisArg); | ||
return $group(this, callbackfn, thisArg); | ||
} | ||
@@ -16,0 +17,0 @@ }); |
@@ -5,4 +5,4 @@ var $ = require('../internals/export'); | ||
// https://rwaldron.github.io/proposal-math-extensions/ | ||
$({ target: 'Math', stat: true, forced: true }, { | ||
$({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true, forced: true }, { | ||
DEG_PER_RAD: Math.PI / 180 | ||
}); |
@@ -5,4 +5,4 @@ var $ = require('../internals/export'); | ||
// https://rwaldron.github.io/proposal-math-extensions/ | ||
$({ target: 'Math', stat: true, forced: true }, { | ||
$({ target: 'Math', stat: true, nonConfigurable: true, nonWritable: true, forced: true }, { | ||
RAD_PER_DEG: 180 / Math.PI | ||
}); |
@@ -0,1 +1,2 @@ | ||
// TODO: Remove from `core-js@4` | ||
var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); | ||
@@ -2,0 +3,0 @@ |
@@ -22,2 +22,6 @@ var IS_PURE = require('../internals/is-pure'); | ||
var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable'); | ||
var V8 = require('../internals/engine-v8-version'); | ||
var IS_BROWSER = require('../internals/engine-is-browser'); | ||
var IS_DENO = require('../internals/engine-is-deno'); | ||
var IS_NODE = require('../internals/engine-is-node'); | ||
@@ -65,7 +69,7 @@ var Object = global.Object; | ||
var checkErrorsCloning = function (structuredCloneImplementation) { | ||
var checkErrorsCloning = function (structuredCloneImplementation, $Error) { | ||
return !fails(function () { | ||
var error = new Error(); | ||
var error = new $Error(); | ||
var test = structuredCloneImplementation({ a: error, b: error }); | ||
return !(test && test.a === test.b && test.a instanceof Error); | ||
return !(test && test.a === test.b && test.a instanceof $Error); | ||
}); | ||
@@ -85,8 +89,13 @@ }; | ||
// https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 | ||
// Chrome <103 returns `null` if cloned object contains multiple references to one error | ||
// Chrome <102 returns `null` if cloned object contains multiple references to one error | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=12542 | ||
// NodeJS implementation can't clone DOMExceptions | ||
// https://github.com/nodejs/node/issues/41038 | ||
// no one of current implementations supports new (html/5749) error cloning semantic | ||
var nativeStructuredClone = global.structuredClone; | ||
var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone) || !checkNewErrorsCloningSemantic(nativeStructuredClone); | ||
var FORCED_REPLACEMENT = IS_PURE | ||
|| !checkErrorsCloning(nativeStructuredClone, Error) | ||
|| !checkErrorsCloning(nativeStructuredClone, DOMException) | ||
|| !checkNewErrorsCloningSemantic(nativeStructuredClone); | ||
@@ -403,2 +412,5 @@ // Chrome 82+, Safari 14.1+, Deno 1.11+ | ||
var PROPER_TRANSFER = nativeStructuredClone && !fails(function () { | ||
// prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation | ||
// https://github.com/zloirock/core-js/issues/679 | ||
if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false; | ||
var buffer = new ArrayBuffer(8); | ||
@@ -405,0 +417,0 @@ var clone = nativeStructuredClone(buffer, { transfer: [buffer] }); |
{ | ||
"name": "core-js-pure", | ||
"description": "Standard library", | ||
"version": "3.22.8", | ||
"version": "3.23.0", | ||
"repository": { | ||
@@ -6,0 +6,0 @@ "type": "git", |
// https://github.com/tc39/proposal-array-grouping | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/esnext.array.group-by'); | ||
require('../modules/esnext.array.group-by-to-map'); |
@@ -1,4 +0,3 @@ | ||
// TODO: The metadata API is splitting out into a separate Stage 2 proposal | ||
// so required a new entry point for it when it will be finally formed | ||
// TODO: Remove from `core-js@4` | ||
// https://github.com/tc39/proposal-decorators | ||
require('../modules/esnext.symbol.metadata'); |
@@ -25,3 +25,3 @@ ![logo](https://user-images.githubusercontent.com/2213682/146607186-8e13ddef-26a4-4ebf-befd-5aac9d77c090.png) | ||
[*Example of usage*](https://is.gd/XD4mRe): | ||
[*Example of usage*](https://tinyurl.com/2aj9lkwf): | ||
```js | ||
@@ -31,3 +31,3 @@ import 'core-js/actual'; // <- at the top of your entry point | ||
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] | ||
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] } | ||
[1, 2, 3, 4, 5].group(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] } | ||
Promise.resolve(42).then(x => console.log(x)); // => 42 | ||
@@ -41,3 +41,3 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3]) | ||
import 'core-js/actual/array/from'; // <- at the top of your entry point | ||
import 'core-js/actual/array/group-by'; // <- at the top of your entry point | ||
import 'core-js/actual/array/group'; // <- at the top of your entry point | ||
import 'core-js/actual/set'; // <- at the top of your entry point | ||
@@ -49,3 +49,3 @@ import 'core-js/actual/promise'; // <- at the top of your entry point | ||
Array.from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] | ||
[1, 2, 3, 4, 5].groupBy(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] } | ||
[1, 2, 3, 4, 5].group(it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] } | ||
Promise.resolve(42).then(x => console.log(x)); // => 42 | ||
@@ -59,3 +59,3 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3]) | ||
import from from 'core-js-pure/actual/array/from'; | ||
import groupBy from 'core-js-pure/actual/array/group-by'; | ||
import group from 'core-js-pure/actual/array/group'; | ||
import Set from 'core-js-pure/actual/set'; | ||
@@ -67,3 +67,3 @@ import Promise from 'core-js-pure/actual/promise'; | ||
from(new Set([1, 2, 3, 2, 1])); // => [1, 2, 3] | ||
groupBy([1, 2, 3, 4, 5], it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] } | ||
group([1, 2, 3, 4, 5], it => it % 2); // => { 1: [1, 3, 5], 0: [2, 4] } | ||
Promise.resolve(42).then(x => console.log(x)); // => 42 | ||
@@ -70,0 +70,0 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3]) |
@@ -28,2 +28,4 @@ require('../modules/es.symbol'); | ||
require('../modules/es.array.find-index'); | ||
require('../modules/es.array.find-last'); | ||
require('../modules/es.array.find-last-index'); | ||
require('../modules/es.array.flat'); | ||
@@ -41,2 +43,3 @@ require('../modules/es.array.flat-map'); | ||
require('../modules/es.array.of'); | ||
require('../modules/es.array.push'); | ||
require('../modules/es.array.reduce'); | ||
@@ -52,2 +55,3 @@ require('../modules/es.array.reduce-right'); | ||
require('../modules/es.array.unscopables.flat-map'); | ||
require('../modules/es.array.unshift'); | ||
require('../modules/es.array-buffer.constructor'); | ||
@@ -208,2 +212,4 @@ require('../modules/es.array-buffer.is-view'); | ||
require('../modules/es.typed-array.find-index'); | ||
require('../modules/es.typed-array.find-last'); | ||
require('../modules/es.typed-array.find-last-index'); | ||
require('../modules/es.typed-array.for-each'); | ||
@@ -210,0 +216,0 @@ require('../modules/es.typed-array.from'); |
require('../proposals/array-from-async-stage-2'); | ||
require('../proposals/array-is-template-object'); | ||
require('../proposals/decorators'); | ||
require('../proposals/decorator-metadata'); | ||
require('../proposals/iterator-helpers'); | ||
@@ -10,4 +10,5 @@ require('../proposals/map-upsert-stage-2'); | ||
require('../proposals/array-grouping'); | ||
require('../proposals/decorators'); | ||
var parent = require('./3'); | ||
module.exports = parent; |
require('../proposals/array-find-from-last'); | ||
require('../proposals/array-grouping-stage-3-2'); | ||
require('../proposals/change-array-by-copy'); | ||
// TODO: Obsolete versions, remove from `core-js@4` | ||
require('../proposals/array-grouping-stage-3'); | ||
require('../proposals/change-array-by-copy'); | ||
var parent = require('./4'); | ||
module.exports = parent; |
881870
3085
20586