Socket
Socket
Sign inDemoInstall

core-js-pure

Package Overview
Dependencies
Maintainers
2
Versions
153
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-js-pure - npm Package Compare versions

Comparing version 3.8.3 to 3.9.0

features/array/find-last-index.js

2

es/json/stringify.js

@@ -6,5 +6,5 @@ require('../../modules/es.json.stringify');

// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
module.exports = function stringify(it, replacer, space) {
return core.JSON.stringify.apply(null, arguments);
};

@@ -5,2 +5,4 @@ var parent = require('../../es/array');

require('../../modules/esnext.array.filter-out');
require('../../modules/esnext.array.find-last');
require('../../modules/esnext.array.find-last-index');
require('../../modules/esnext.array.is-template-object');

@@ -7,0 +9,0 @@ require('../../modules/esnext.array.last-item');

var parent = require('../../../es/array/virtual');
require('../../../modules/es.map');
require('../../../modules/esnext.array.at');
require('../../../modules/esnext.array.filter-out');
require('../../../modules/esnext.array.find-last');
require('../../../modules/esnext.array.find-last-index');
require('../../../modules/esnext.array.unique-by');
module.exports = parent;
var parent = require('../../es/typed-array');
require('../../modules/es.map');
require('../../modules/esnext.typed-array.at');
require('../../modules/esnext.typed-array.filter-out');
require('../../modules/esnext.typed-array.find-last');
require('../../modules/esnext.typed-array.find-last-index');
require('../../modules/esnext.typed-array.unique-by');
module.exports = parent;
'use strict';
var $forEach = require('../internals/array-iteration').forEach;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('forEach');
var USES_TO_LENGTH = arrayMethodUsesToLength('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.foreach
module.exports = (!STRICT_METHOD || !USES_TO_LENGTH) ? function forEach(callbackfn /* , thisArg */) {
module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
} : [].forEach;

@@ -13,6 +13,6 @@ var toIndexedObject = require('../internals/to-indexed-object');

// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
if (IS_INCLUDES && el != el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
if (value != value) return true;

@@ -19,0 +19,0 @@ // Array#indexOf ignores holes, Array#includes - not

@@ -6,3 +6,2 @@ 'use strict';

var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');

@@ -13,5 +12,3 @@ var min = Math.min;

var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
// For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH;
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;

@@ -18,0 +15,0 @@ // `Array.prototype.lastIndexOf` method implementation

@@ -7,5 +7,5 @@ 'use strict';

return !!method && fails(function () {
// eslint-disable-next-line no-useless-call,no-throw-literal
// eslint-disable-next-line no-useless-call,no-throw-literal -- required for testing
method.call(null, argument || function () { throw 1; }, 1);
});
};

@@ -22,3 +22,3 @@ var global = require('../internals/global');

try {
// eslint-disable-next-line no-new-func
// eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax
prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function('return async function*(){}()')())));

@@ -25,0 +25,0 @@ if (getPrototypeOf(prototype) === Object.prototype) AsyncIteratorPrototype = prototype;

@@ -19,3 +19,3 @@ var wellKnownSymbol = require('../internals/well-known-symbol');

};
// eslint-disable-next-line no-throw-literal
// eslint-disable-next-line no-throw-literal -- required for testing
Array.from(iteratorWithReturn, function () { throw 2; });

@@ -22,0 +22,0 @@ } catch (error) { /* empty */ }

@@ -11,3 +11,3 @@ 'use strict';

for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
// eslint-disable-next-line no-new-func
// eslint-disable-next-line no-new-func -- we have no proper alternatives, IE8- only
factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')');

@@ -14,0 +14,0 @@ } return factories[argsLength](C, args);

@@ -5,4 +5,4 @@ var IS_PURE = require('../internals/is-pure');

module.exports = IS_PURE ? getIterator : function (it) {
// eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef -- safe
return Map.prototype.entries.call(it);
};

@@ -5,4 +5,4 @@ var IS_PURE = require('../internals/is-pure');

module.exports = IS_PURE ? getIterator : function (it) {
// eslint-disable-next-line no-undef
// eslint-disable-next-line no-undef -- safe
return Set.prototype.values.call(it);
};

@@ -7,3 +7,3 @@ var check = function (it) {

module.exports =
// eslint-disable-next-line no-undef
/* global globalThis -- safe */
check(typeof globalThis == 'object' && globalThis) ||

@@ -13,3 +13,3 @@ check(typeof window == 'object' && window) ||

check(typeof global == 'object' && global) ||
// eslint-disable-next-line no-new-func
// eslint-disable-next-line no-new-func -- fallback
(function () { return this; })() || Function('return this')();
// IEEE754 conversions based on https://github.com/feross/ieee754
// eslint-disable-next-line no-shadow-restricted-names
var Infinity = 1 / 0;
var abs = Math.abs;

@@ -20,5 +18,5 @@ var pow = Math.pow;

number = abs(number);
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
if (number != number || number === Infinity) {
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
mantissa = number != number ? 1 : 0;

@@ -25,0 +23,0 @@ exponent = eMax;

@@ -9,3 +9,3 @@ var fails = require('../internals/fails');

// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
return !Object('z').propertyIsEnumerable(0);

@@ -12,0 +12,0 @@ }) ? function (it) {

@@ -11,4 +11,4 @@ var classof = require('../internals/classof');

|| '@@iterator' in O
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
|| Iterators.hasOwnProperty(classof(O));
};

@@ -23,5 +23,5 @@ var sign = require('../internals/math-sign');

result = a - (a - $abs);
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
if (result > MAX32 || result != result) return $sign * Infinity;
return $sign * result;
};

@@ -6,3 +6,3 @@ // `Math.scale` method implementation

arguments.length === 0
/* eslint-disable no-self-compare */
/* eslint-disable no-self-compare -- NaN check */
|| x != x

@@ -13,3 +13,3 @@ || inLow != inLow

|| outHigh != outHigh
/* eslint-enable no-self-compare */
/* eslint-enable no-self-compare -- NaN check */
) return NaN;

@@ -16,0 +16,0 @@ if (x === Infinity || x === -Infinity) return x;

// `Math.sign` method implementation
// https://tc39.es/ecma262/#sec-math.sign
module.exports = Math.sign || function sign(x) {
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
};

@@ -5,4 +5,4 @@ var fails = require('../internals/fails');

// Chrome 38 Symbol has incorrect toString conversion
// eslint-disable-next-line no-undef
/* global Symbol -- required for testing */
return !String(Symbol());
});

@@ -29,3 +29,3 @@ 'use strict';

var B = {};
// eslint-disable-next-line no-undef
/* global Symbol -- required for testing */
var symbol = Symbol();

@@ -36,3 +36,3 @@ var alphabet = 'abcdefghijklmnopqrst';

return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
var T = toObject(target);

@@ -39,0 +39,0 @@ var argumentsLength = arguments.length;

@@ -55,3 +55,3 @@ var anObject = require('../internals/an-object');

try {
/* global ActiveXObject */
/* global ActiveXObject -- old IE */
activeXDocument = document.domain && new ActiveXObject('htmlfile');

@@ -58,0 +58,0 @@ } catch (error) { /* ignore */ }

@@ -10,5 +10,5 @@ 'use strict';

// In FF throws only define methods
// eslint-disable-next-line no-undef, no-useless-call
// eslint-disable-next-line no-undef, no-useless-call -- required for testing
__defineSetter__.call(null, key, function () { /* empty */ });
delete global[key];
});

@@ -0,1 +1,2 @@

/* eslint-disable no-proto -- safe */
var anObject = require('../internals/an-object');

@@ -7,3 +8,2 @@ var aPossiblePrototype = require('../internals/a-possible-prototype');

// Works with __proto__ only. Old v8 can't work with null proto objects.
/* eslint-disable no-proto */
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {

@@ -10,0 +10,0 @@ var CORRECT_SETTER = false;

@@ -43,3 +43,3 @@ 'use strict';

}
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
var hitsEnd = start != start || end != end || step != step || (end > start) !== (step > zero);

@@ -46,0 +46,0 @@ setInternalState(this, {

// `SameValueZero` abstract operation
// https://tc39.es/ecma262/#sec-samevaluezero
module.exports = function (x, y) {
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
return x === y || x != x && y != y;
};
// `SameValue` abstract operation
// https://tc39.es/ecma262/#sec-samevalue
module.exports = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
};

@@ -7,5 +7,5 @@ var IS_PURE = require('../internals/is-pure');

})('versions', []).push({
version: '3.8.3',
version: '3.9.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
});
// https://github.com/zloirock/core-js/issues/280
var userAgent = require('../internals/engine-user-agent');
// eslint-disable-next-line unicorn/no-unsafe-regex
// eslint-disable-next-line unicorn/no-unsafe-regex -- safe
module.exports = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);

@@ -77,3 +77,3 @@ 'use strict';

*/
// eslint-disable-next-line max-statements
// eslint-disable-next-line max-statements -- TODO
var encode = function (input) {

@@ -80,0 +80,0 @@ var output = [];

@@ -21,3 +21,3 @@ var global = require('../internals/global');

var run = function (id) {
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
if (queue.hasOwnProperty(id)) {

@@ -52,3 +52,3 @@ var fn = queue[id];

queue[++counter] = function () {
// eslint-disable-next-line no-new-func
// eslint-disable-next-line no-new-func -- spec requirement
(typeof fn == 'function' ? fn : Function(fn)).apply(undefined, args);

@@ -55,0 +55,0 @@ };

@@ -1,22 +0,1 @@

/* eslint-disable no-new */
var global = require('../internals/global');
var fails = require('../internals/fails');
var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
var NATIVE_ARRAY_BUFFER_VIEWS = require('../internals/array-buffer-view-core').NATIVE_ARRAY_BUFFER_VIEWS;
var ArrayBuffer = global.ArrayBuffer;
var Int8Array = global.Int8Array;
module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
Int8Array(1);
}) || !fails(function () {
new Int8Array(-1);
}) || !checkCorrectnessOfIteration(function (iterable) {
new Int8Array();
new Int8Array(null);
new Int8Array(1.5);
new Int8Array(iterable);
}, true) || fails(function () {
// Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
});
// empty
var NATIVE_SYMBOL = require('../internals/native-symbol');
module.exports = NATIVE_SYMBOL
// eslint-disable-next-line no-undef
/* global Symbol -- safe */
&& !Symbol.sham
// eslint-disable-next-line no-undef
&& typeof Symbol.iterator == 'symbol';
// a string of all valid unicode whitespaces
// eslint-disable-next-line max-len
module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';

@@ -14,3 +14,3 @@ 'use strict';

if (setPrototypeOf) {
// eslint-disable-next-line unicorn/error-message
// eslint-disable-next-line unicorn/error-message -- expected
that = setPrototypeOf(new Error(undefined), getPrototypeOf(that));

@@ -17,0 +17,0 @@ }

@@ -41,3 +41,4 @@ 'use strict';

$({ target: 'Array', proto: true, forced: FORCED }, {
concat: function concat(arg) { // eslint-disable-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
concat: function concat(arg) {
var O = toObject(this);

@@ -44,0 +45,0 @@ var A = arraySpeciesCreate(O, 0);

@@ -5,10 +5,8 @@ 'use strict';

var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('every');
var USES_TO_LENGTH = arrayMethodUsesToLength('every');
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
every: function every(callbackfn /* , thisArg */) {

@@ -15,0 +13,0 @@ return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,7 +5,4 @@ 'use strict';

var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('filter');
// Edge 14- issue
var USES_TO_LENGTH = arrayMethodUsesToLength('filter');

@@ -15,3 +12,3 @@ // `Array.prototype.filter` method

// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
filter: function filter(callbackfn /* , thisArg */) {

@@ -18,0 +15,0 @@ return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,3 +5,2 @@ 'use strict';

var addToUnscopables = require('../internals/add-to-unscopables');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');

@@ -11,4 +10,2 @@ var FIND_INDEX = 'findIndex';

var USES_TO_LENGTH = arrayMethodUsesToLength(FIND_INDEX);
// Shouldn't skip holes

@@ -19,3 +16,3 @@ if (FIND_INDEX in []) Array(1)[FIND_INDEX](function () { SKIPS_HOLES = false; });

// https://tc39.es/ecma262/#sec-array.prototype.findindex
$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
findIndex: function findIndex(callbackfn /* , that = undefined */) {

@@ -22,0 +19,0 @@ return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,3 +5,2 @@ 'use strict';

var addToUnscopables = require('../internals/add-to-unscopables');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');

@@ -11,4 +10,2 @@ var FIND = 'find';

var USES_TO_LENGTH = arrayMethodUsesToLength(FIND);
// Shouldn't skip holes

@@ -19,3 +16,3 @@ if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES = false; });

// https://tc39.es/ecma262/#sec-array.prototype.find
$({ target: 'Array', proto: true, forced: SKIPS_HOLES || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: SKIPS_HOLES }, {
find: function find(callbackfn /* , that = undefined */) {

@@ -22,0 +19,0 @@ return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,9 +5,6 @@ 'use strict';

var addToUnscopables = require('../internals/add-to-unscopables');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
$({ target: 'Array', proto: true, forced: !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true }, {
includes: function includes(el /* , fromIndex = 0 */) {

@@ -14,0 +11,0 @@ return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,3 +5,2 @@ 'use strict';

var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');

@@ -12,7 +11,6 @@ var nativeIndexOf = [].indexOf;

var STRICT_METHOD = arrayMethodIsStrict('indexOf');
var USES_TO_LENGTH = arrayMethodUsesToLength('indexOf', { ACCESSORS: true, 1: 0 });
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || !STRICT_METHOD }, {
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {

@@ -19,0 +17,0 @@ return NEGATIVE_ZERO

@@ -5,7 +5,4 @@ 'use strict';

var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
// FF49- issue
var USES_TO_LENGTH = arrayMethodUsesToLength('map');

@@ -15,3 +12,3 @@ // `Array.prototype.map` method

// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
map: function map(callbackfn /* , thisArg */) {

@@ -18,0 +15,0 @@ return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,3 +5,2 @@ 'use strict';

var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var CHROME_VERSION = require('../internals/engine-v8-version');

@@ -11,4 +10,2 @@ var IS_NODE = require('../internals/engine-is-node');

var STRICT_METHOD = arrayMethodIsStrict('reduceRight');
// For preventing possible almost infinite loop in non-standard implementations, test the forward version of the method
var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
// Chrome 80-82 has a critical bug

@@ -20,3 +17,3 @@ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982

// https://tc39.es/ecma262/#sec-array.prototype.reduceright
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
reduceRight: function reduceRight(callbackfn /* , initialValue */) {

@@ -23,0 +20,0 @@ return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);

@@ -5,3 +5,2 @@ 'use strict';

var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var CHROME_VERSION = require('../internals/engine-v8-version');

@@ -11,3 +10,2 @@ var IS_NODE = require('../internals/engine-is-node');

var STRICT_METHOD = arrayMethodIsStrict('reduce');
var USES_TO_LENGTH = arrayMethodUsesToLength('reduce', { 1: 0 });
// Chrome 80-82 has a critical bug

@@ -19,3 +17,3 @@ // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982

// https://tc39.es/ecma262/#sec-array.prototype.reduce
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH || CHROME_BUG }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {
reduce: function reduce(callbackfn /* , initialValue */) {

@@ -22,0 +20,0 @@ return $reduce(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : undefined);

@@ -14,3 +14,3 @@ 'use strict';

reverse: function reverse() {
// eslint-disable-next-line no-self-assign
// eslint-disable-next-line no-self-assign -- dirty hack
if (isArray(this)) this.length = this.length;

@@ -17,0 +17,0 @@ return nativeReverse.call(this);

@@ -11,6 +11,4 @@ 'use strict';

var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
var USES_TO_LENGTH = arrayMethodUsesToLength('slice', { ACCESSORS: true, 0: 0, 1: 2 });

@@ -24,3 +22,3 @@ var SPECIES = wellKnownSymbol('species');

// fallback for not array-like ES3 strings and DOM objects
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
slice: function slice(start, end) {

@@ -27,0 +25,0 @@ var O = toIndexedObject(this);

@@ -5,10 +5,8 @@ 'use strict';

var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var STRICT_METHOD = arrayMethodIsStrict('some');
var USES_TO_LENGTH = arrayMethodUsesToLength('some');
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
$({ target: 'Array', proto: true, forced: !STRICT_METHOD || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: !STRICT_METHOD }, {
some: function some(callbackfn /* , thisArg */) {

@@ -15,0 +13,0 @@ return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);

@@ -10,6 +10,4 @@ 'use strict';

var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support');
var arrayMethodUsesToLength = require('../internals/array-method-uses-to-length');
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
var USES_TO_LENGTH = arrayMethodUsesToLength('splice', { ACCESSORS: true, 0: 0, 1: 2 });

@@ -24,3 +22,3 @@ var max = Math.max;

// with adding support of @@species
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT || !USES_TO_LENGTH }, {
$({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
splice: function splice(start, deleteCount /* , ...items */) {

@@ -27,0 +25,0 @@ var O = toObject(this);

@@ -17,3 +17,3 @@ 'use strict';

$({ target: 'Date', proto: true, forced: FORCED }, {
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
toJSON: function toJSON(key) {

@@ -20,0 +20,0 @@ var O = toObject(this);

@@ -28,3 +28,3 @@ var $ = require('../internals/export');

$({ target: 'JSON', stat: true, forced: FORCED }, {
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
stringify: function stringify(it, replacer, space) {

@@ -31,0 +31,0 @@ var result = $stringify.apply(null, arguments);

@@ -14,3 +14,4 @@ var $ = require('../internals/export');

$({ target: 'Math', stat: true, forced: BUGGY }, {
hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
hypot: function hypot(value1, value2) {
var sum = 0;

@@ -17,0 +18,0 @@ var i = 0;

@@ -7,5 +7,5 @@ var $ = require('../internals/export');

isNaN: function isNaN(number) {
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
return number != number;
}
});

@@ -28,2 +28,33 @@ 'use strict';

var multiply = function (data, n, c) {
var index = -1;
var c2 = c;
while (++index < 6) {
c2 += n * data[index];
data[index] = c2 % 1e7;
c2 = floor(c2 / 1e7);
}
};
var divide = function (data, n) {
var index = 6;
var c = 0;
while (--index >= 0) {
c += data[index];
data[index] = floor(c / n);
c = (c % n) * 1e7;
}
};
var dataToString = function (data) {
var index = 6;
var s = '';
while (--index >= 0) {
if (s !== '' || index === 0 || data[index] !== 0) {
var t = String(data[index]);
s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
}
} return s;
};
var FORCED = nativeToFixed && (

@@ -42,3 +73,2 @@ 0.00008.toFixed(3) !== '0.000' ||

$({ target: 'Number', proto: true, forced: FORCED }, {
// eslint-disable-next-line max-statements
toFixed: function toFixed(fractionDigits) {

@@ -52,35 +82,4 @@ var number = thisNumberValue(this);

var multiply = function (n, c) {
var index = -1;
var c2 = c;
while (++index < 6) {
c2 += n * data[index];
data[index] = c2 % 1e7;
c2 = floor(c2 / 1e7);
}
};
var divide = function (n) {
var index = 6;
var c = 0;
while (--index >= 0) {
c += data[index];
data[index] = floor(c / n);
c = (c % n) * 1e7;
}
};
var dataToString = function () {
var index = 6;
var s = '';
while (--index >= 0) {
if (s !== '' || index === 0 || data[index] !== 0) {
var t = String(data[index]);
s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;
}
} return s;
};
if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');
// eslint-disable-next-line no-self-compare
// eslint-disable-next-line no-self-compare -- NaN check
if (number != number) return 'NaN';

@@ -98,22 +97,22 @@ if (number <= -1e21 || number >= 1e21) return String(number);

if (e > 0) {
multiply(0, z);
multiply(data, 0, z);
j = fractDigits;
while (j >= 7) {
multiply(1e7, 0);
multiply(data, 1e7, 0);
j -= 7;
}
multiply(pow(10, j, 1), 0);
multiply(data, pow(10, j, 1), 0);
j = e - 1;
while (j >= 23) {
divide(1 << 23);
divide(data, 1 << 23);
j -= 23;
}
divide(1 << j);
multiply(1, 1);
divide(2);
result = dataToString();
divide(data, 1 << j);
multiply(data, 1, 1);
divide(data, 2);
result = dataToString(data);
} else {
multiply(0, z);
multiply(1 << -e, 0);
result = dataToString() + repeat.call('0', fractDigits);
multiply(data, 0, z);
multiply(data, 1 << -e, 0);
result = dataToString(data) + repeat.call('0', fractDigits);
}

@@ -120,0 +119,0 @@ }

@@ -240,3 +240,3 @@ 'use strict';

};
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
Internal = function Promise(executor) {

@@ -301,3 +301,3 @@ setInternalState(this, {

if (typeof $fetch == 'function') $({ global: true, enumerable: true, forced: true }, {
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
fetch: function fetch(input /* , init */) {

@@ -304,0 +304,0 @@ return promiseResolve(PromiseConstructor, $fetch.apply(global, arguments));

@@ -10,3 +10,3 @@ var $ = require('../internals/export');

var ERROR_INSTEAD_OF_FALSE = fails(function () {
// eslint-disable-next-line no-undef
/* global Reflect -- required for testing */
Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });

@@ -13,0 +13,0 @@ });

@@ -40,3 +40,3 @@ var $ = require('../internals/export');

var object = definePropertyModule.f(new Constructor(), 'a', { configurable: true });
// eslint-disable-next-line no-undef
/* global Reflect -- required for testing */
return Reflect.set(Constructor.prototype, 'a', 1, object) !== false;

@@ -43,0 +43,0 @@ });

@@ -13,3 +13,4 @@ var $ = require('../internals/export');

$({ target: 'String', stat: true, forced: INCORRECT_LENGTH }, {
fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
fromCodePoint: function fromCodePoint(x) {
var elements = [];

@@ -16,0 +17,0 @@ var length = arguments.length;

@@ -42,3 +42,3 @@ 'use strict';

// eslint-disable-next-line max-len
// eslint-disable-next-line max-len -- ignore
var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, global, fullUnicode) {

@@ -45,0 +45,0 @@ setInternalState(this, {

@@ -284,3 +284,3 @@ 'use strict';

$({ target: 'JSON', stat: true, forced: FORCED_JSON_STRINGIFY }, {
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
stringify: function stringify(it, replacer, space) {

@@ -287,0 +287,0 @@ var args = [it];

'use strict';
var $ = require('../internals/export');
var toLength = require('../internals/to-length');
var toObject = require('../internals/to-object');
var getBuiltIn = require('../internals/get-built-in');
var arraySpeciesCreate = require('../internals/array-species-create');
var addToUnscopables = require('../internals/add-to-unscopables');
var uniqueBy = require('../internals/array-unique-by');
var push = [].push;
// `Array.prototype.uniqueBy` method
// https://github.com/tc39/proposal-array-unique
$({ target: 'Array', proto: true }, {
uniqueBy: function uniqueBy(resolver) {
var that = toObject(this);
var length = toLength(that.length);
var result = arraySpeciesCreate(that, 0);
var Map = getBuiltIn('Map');
var map = new Map();
var resolverFunction, index, item, key;
if (typeof resolver == 'function') resolverFunction = resolver;
else if (resolver == null) resolverFunction = function (value) {
return value;
};
else throw new TypeError('Incorrect resolver!');
for (index = 0; index < length; index++) {
item = that[index];
key = resolverFunction(item);
if (!map.has(key)) map.set(key, item);
}
map.forEach(function (value) {
push.call(result, value);
});
return result;
}
uniqueBy: uniqueBy
});
addToUnscopables('uniqueBy');

@@ -10,3 +10,3 @@ 'use strict';

range: function range(start, end, option) {
// eslint-disable-next-line no-undef
/* global BigInt -- safe */
return new RangeIterator(start, end, option, 'bigint', BigInt(0), BigInt(1));

@@ -13,0 +13,0 @@ }

@@ -11,3 +11,3 @@ 'use strict';

$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
merge: function merge(iterable /* ...iterbles */) {

@@ -14,0 +14,0 @@ var map = anObject(this);

@@ -13,3 +13,3 @@ var $ = require('../internals/export');

return scheduler(boundArgs ? function () {
// eslint-disable-next-line no-new-func
// eslint-disable-next-line no-new-func -- spec requirement
(typeof handler == 'function' ? handler : Function(handler)).apply(this, args);

@@ -16,0 +16,0 @@ } : handler, timeout);

@@ -40,10 +40,8 @@ 'use strict';

var HEX = /^[\dA-Fa-f]+$/;
// eslint-disable-next-line no-control-regex
var FORBIDDEN_HOST_CODE_POINT = /[\u0000\u0009\u000A\u000D #%/:?@[\\]]/;
// eslint-disable-next-line no-control-regex
var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\u0009\u000A\u000D #/:?@[\\]]/;
// eslint-disable-next-line no-control-regex
/* eslint-disable no-control-regex -- safe */
var FORBIDDEN_HOST_CODE_POINT = /[\u0000\t\u000A\u000D #%/:?@[\\]]/;
var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\u0000\t\u000A\u000D #/:?@[\\]]/;
var LEADING_AND_TRAILING_C0_CONTROL_OR_SPACE = /^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g;
// eslint-disable-next-line no-control-regex
var TAB_AND_NEW_LINE = /[\u0009\u000A\u000D]/g;
var TAB_AND_NEW_LINE = /[\t\u000A\u000D]/g;
/* eslint-enable no-control-regex -- safe */
var EOF;

@@ -114,3 +112,3 @@

// eslint-disable-next-line max-statements
// eslint-disable-next-line max-statements -- TODO
var parseIPv6 = function (input) {

@@ -337,3 +335,3 @@ var address = [0, 0, 0, 0, 0, 0, 0, 0];

// eslint-disable-next-line max-statements
// eslint-disable-next-line max-statements -- TODO
var parseURL = function (url, input, stateOverride, base) {

@@ -994,3 +992,3 @@ var state = stateOverride || SCHEME_START;

// https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
if (nativeCreateObjectURL) redefine(URLConstructor, 'createObjectURL', function createObjectURL(blob) {

@@ -1001,3 +999,3 @@ return nativeCreateObjectURL.apply(NativeURL, arguments);

// https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
// eslint-disable-next-line no-unused-vars
// eslint-disable-next-line no-unused-vars -- required for `.length`
if (nativeRevokeObjectURL) redefine(URLConstructor, 'revokeObjectURL', function revokeObjectURL(url) {

@@ -1004,0 +1002,0 @@ return nativeRevokeObjectURL.apply(NativeURL, arguments);

{
"name": "core-js-pure",
"description": "Standard library",
"version": "3.8.3",
"version": "3.9.0",
"repository": {

@@ -57,3 +57,3 @@ "type": "git",

},
"gitHead": "a88734f1d7d8c1b5bb797e1b8ece2ec1961111c6"
"gitHead": "37970c09678489b5663bd051342c2055f6982f37"
}

@@ -1,2 +0,2 @@

/* eslint-disable max-len */
/* eslint-disable max-len -- for better formatting */
var fs = require('fs');

@@ -54,3 +54,3 @@ var os = require('os');

function showBanner() {
// eslint-disable-next-line no-console,no-control-regex
// eslint-disable-next-line no-console,no-control-regex -- output
console.log(COLOR ? BANNER : BANNER.replace(/\u001B\[\d+m/g, ''));

@@ -57,0 +57,0 @@ }

// https://github.com/tc39/proposal-array-unique
require('../modules/es.map');
require('../modules/esnext.array.unique-by');
require('../modules/esnext.typed-array.unique-by');

@@ -14,4 +14,4 @@ require('../../modules/web.dom-collections.iterator');

return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.entries)
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
|| DOMIterables.hasOwnProperty(classof(it)) ? entries : own;
};

@@ -14,4 +14,4 @@ require('../../modules/web.dom-collections.iterator');

return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach)
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
|| DOMIterables.hasOwnProperty(classof(it)) ? forEach : own;
};

@@ -14,4 +14,4 @@ require('../../modules/web.dom-collections.iterator');

return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.keys)
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
|| DOMIterables.hasOwnProperty(classof(it)) ? keys : own;
};

@@ -14,4 +14,4 @@ require('../../modules/web.dom-collections.iterator');

return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.values)
// eslint-disable-next-line no-prototype-builtins
// eslint-disable-next-line no-prototype-builtins -- safe
|| DOMIterables.hasOwnProperty(classof(it)) ? values : own;
};
require('../proposals/array-filtering');
require('../proposals/array-find-from-last');
require('../proposals/array-last');

@@ -3,0 +4,0 @@ require('../proposals/array-unique');

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc