Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

core-js

Package Overview
Dependencies
Maintainers
1
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

core-js - npm Package Compare versions

Comparing version 3.23.2 to 3.23.3

internals/is-big-int-array.js

6

internals/define-built-in.js

@@ -15,4 +15,6 @@ var isCallable = require('../internals/is-callable');

} else {
if (!options.unsafe) delete O[key];
else if (O[key]) simple = true;
try {
if (!options.unsafe) delete O[key];
else if (O[key]) simple = true;
} catch (error) { /* empty */ }
if (simple) O[key] = value;

@@ -19,0 +21,0 @@ else definePropertyModule.f(O, key, {

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

if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
defineProperty(value, 'name', { value: name, configurable: true });
if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
else value.name = name;
}

@@ -30,0 +31,0 @@ if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {

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

})('versions', []).push({
version: '3.23.2',
version: '3.23.3',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.23.2/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.23.3/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
'use strict';
var $ = require('../internals/export');
var addToUnscopables = require('../internals/add-to-unscopables');
var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var toIndexedObject = require('../internals/to-indexed-object');
var arraySlice = require('../internals/array-slice');
var arrayToSpliced = require('../internals/array-to-spliced');
var addToUnscopables = require('../internals/add-to-unscopables');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var $Array = Array;
var max = Math.max;
var min = Math.min;
// `Array.prototype.toSpliced` method
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toSpliced
$({ target: 'Array', proto: true, arity: 2 }, {
// eslint-disable-next-line no-unused-vars -- required for .length
$({ target: 'Array', proto: true }, {
toSpliced: function toSpliced(start, deleteCount /* , ...items */) {
return arrayToSpliced(toIndexedObject(this), $Array, arraySlice(arguments));
var O = toIndexedObject(this);
var len = lengthOfArrayLike(O);
var actualStart = toAbsoluteIndex(start, len);
var argumentsLength = arguments.length;
var k = 0;
var insertCount, actualDeleteCount, newLen, A;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
}
newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
A = $Array(newLen);
for (; k < actualStart; k++) A[k] = O[k];
for (; k < actualStart + insertCount; k++) A[k] = arguments[k - actualStart + 2];
for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount];
return A;
}

@@ -17,0 +42,0 @@ });

'use strict';
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var arraySlice = require('../internals/array-slice');
var arrayToSpliced = require('../internals/array-to-spliced');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var fails = require('../internals/fails');

@@ -9,8 +11,53 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;

var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var max = Math.max;
var min = Math.min;
// some early implementations, like WebKit, does not follow the final semantic
var PROPER_ORDER = !fails(function () {
// eslint-disable-next-line es-x/no-typed-arrays -- required for testing
var array = new Int8Array([1]);
var spliced = array.toSpliced(1, 0, {
valueOf: function () {
array[0] = 2;
return 3;
}
});
return spliced[0] !== 2 || spliced[1] !== 3;
});
// `%TypedArray%.prototype.toSpliced` method
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toSpliced
// eslint-disable-next-line no-unused-vars -- required for .length
exportTypedArrayMethod('toSpliced', function toSpliced(start, deleteCount /* , ...items */) {
return arrayToSpliced(aTypedArray(this), getTypedArrayConstructor(this), arraySlice(arguments));
}, { arity: 2 });
var O = aTypedArray(this);
var C = getTypedArrayConstructor(O);
var len = lengthOfArrayLike(O);
var actualStart = toAbsoluteIndex(start, len);
var argumentsLength = arguments.length;
var k = 0;
var insertCount, actualDeleteCount, convertedItems, newLen, A;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
insertCount = argumentsLength - 2;
if (insertCount) {
convertedItems = new C(insertCount);
for (var i = 2; i < argumentsLength; i++) {
convertedItems[i - 2] = arguments[i];
}
}
}
newLen = len + insertCount - actualDeleteCount;
A = new C(newLen);
for (; k < actualStart; k++) A[k] = O[k];
for (; k < actualStart + insertCount; k++) A[k] = convertedItems[k - actualStart];
for (; k < newLen; k++) A[k] = O[k + actualDeleteCount - insertCount];
return A;
}, !PROPER_ORDER);
'use strict';
var arrayWith = require('../internals/array-with');
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var isBigIntArray = require('../internals/is-big-int-array');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toBigInt = require('../internals/to-big-int');
var classof = require('../internals/classof');
var uncurryThis = require('../internals/function-uncurry-this');

@@ -12,3 +11,2 @@ var aTypedArray = ArrayBufferViewCore.aTypedArray;

var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var slice = uncurryThis(''.slice);

@@ -29,6 +27,6 @@ var PROPER_ORDER = !!function () {

exportTypedArrayMethod('with', { 'with': function (index, value) {
aTypedArray(this);
var O = aTypedArray(this);
var relativeIndex = toIntegerOrInfinity(index);
var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
return arrayWith(this, getTypedArrayConstructor(this), relativeIndex, actualValue);
var actualValue = isBigIntArray(O) ? toBigInt(value) : +value;
return arrayWith(O, getTypedArrayConstructor(O), relativeIndex, actualValue);
} }['with'], !PROPER_ORDER);
{
"name": "core-js",
"description": "Standard library",
"version": "3.23.2",
"version": "3.23.3",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

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