Socket
Book a DemoSign in
Socket

core-js

Package Overview
Dependencies
Maintainers
1
Versions
288
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.48.0
to
3.49.0
+1
-1
configurator.js

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

module.exports = function (options) {
if (typeof options == 'object') {
if (options && typeof options == 'object') {
setAggressivenessLevel(options.useNative, isForced.NATIVE);

@@ -20,0 +20,0 @@ setAggressivenessLevel(options.usePolyfill, isForced.POLYFILL);

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

var defineProperties = module.exports = function defineProperties(T, D) {
var $defineProperties = module.exports = function defineProperties(T, D) {
return Object.defineProperties(T, D);
};
if (Object.defineProperties.sham) defineProperties.sham = true;
if (Object.defineProperties.sham) $defineProperties.sham = true;

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

var defineProperty = module.exports = function defineProperty(it, key, desc) {
var $defineProperty = module.exports = function defineProperty(it, key, desc) {
return Object.defineProperty(it, key, desc);
};
if (Object.defineProperty.sham) defineProperty.sham = true;
if (Object.defineProperty.sham) $defineProperty.sham = true;

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

var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
var $getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) {
return Object.getOwnPropertyDescriptor(it, key);
};
if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
if (Object.getOwnPropertyDescriptor.sham) $getOwnPropertyDescriptor.sham = true;

@@ -13,4 +13,4 @@ 'use strict';

// eslint-disable-next-line no-unused-vars -- required for arity
module.exports = ({ 'try': function (callbackfn /* , ...args */) {
module.exports = { 'try': function (callbackfn /* , ...args */) {
return apply($try, isCallable(this) ? this : Promise, arguments);
} })['try'];
} }['try'];

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

module.exports = function (S, index, unicode) {
return index + (unicode ? charAt(S, index).length : 1);
return index + (unicode ? charAt(S, index).length || 1 : 1);
};

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

var DataView = globalThis.DataView;
var max = Math.max;
var min = Math.min;

@@ -37,3 +38,5 @@ var ArrayBufferPrototype = ArrayBuffer.prototype;

} else {
var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : undefined;
var options = preserveResizability && !fixedLength && maxByteLength
? { maxByteLength: max(newByteLength, maxByteLength(arrayBuffer)) }
: undefined;
newBuffer = new ArrayBuffer(newByteLength, options);

@@ -40,0 +43,0 @@ var a = new DataView(arrayBuffer);

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

for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) {
createNonEnumerableProperty(globalThis[NAME], TYPED_ARRAY_TAG, NAME);
createNonEnumerableProperty(globalThis[NAME].prototype, TYPED_ARRAY_TAG, NAME);
}

@@ -180,0 +180,0 @@ }

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

var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toLength = require('../internals/to-length');
var toIndex = require('../internals/to-index');

@@ -130,3 +129,3 @@ var fround = require('../internals/math-fround');

if (offset < 0 || offset > bufferLength) throw new RangeError('Wrong offset');
byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
byteLength = byteLength === undefined ? bufferLength - offset : toIndex(byteLength);
if (offset + byteLength > bufferLength) throw new RangeError(WRONG_LENGTH);

@@ -133,0 +132,0 @@ setInternalState(this, {

'use strict';
var bind = require('../internals/function-bind-context');
var uncurryThis = require('../internals/function-uncurry-this');
var toObject = require('../internals/to-object');
var isConstructor = require('../internals/is-constructor');

@@ -35,3 +34,3 @@ var getAsyncIterator = require('../internals/get-async-iterator');

// https://github.com/tc39/proposal-array-from-async
module.exports = function fromAsync(asyncItems /* , mapfn = undefined, thisArg = undefined */) {
module.exports = function fromAsync(items /* , mapfn = undefined, thisArg = undefined */) {
var C = this;

@@ -42,12 +41,11 @@ var argumentsLength = arguments.length;

return new (getBuiltIn('Promise'))(function (resolve) {
var O = toObject(asyncItems);
if (mapfn !== undefined) mapfn = bind(mapfn, thisArg);
var usingAsyncIterator = getMethod(O, ASYNC_ITERATOR);
var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod(O) || safeArrayIterator;
var usingAsyncIterator = getMethod(items, ASYNC_ITERATOR);
var usingSyncIterator = usingAsyncIterator ? undefined : getIteratorMethod(items) || safeArrayIterator;
var A = isConstructor(C) ? new C() : [];
var iterator = usingAsyncIterator
? getAsyncIterator(O, usingAsyncIterator)
: new AsyncFromSyncIterator(getIteratorDirect(getIterator(O, usingSyncIterator)));
? getAsyncIterator(items, usingAsyncIterator)
: new AsyncFromSyncIterator(getIteratorDirect(getIterator(items, usingSyncIterator)));
resolve(toArray(iterator, mapfn, A));
});
};

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

var getIteratorMethod = require('../internals/get-iterator-method');
var iteratorClose = require('../internals/iterator-close');

@@ -20,3 +21,2 @@ var $Array = Array;

module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var IS_CONSTRUCTOR = isConstructor(this);

@@ -27,2 +27,3 @@ var argumentsLength = arguments.length;

if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
var O = toObject(arrayLike);
var iteratorMethod = getIteratorMethod(O);

@@ -38,3 +39,7 @@ var index = 0;

value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
createProperty(result, index, value);
try {
createProperty(result, index, value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
}

@@ -41,0 +46,0 @@ } else {

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

var state = getInternalState(this);
var hasValue = arguments.length > 0;
var value = hasValue ? arguments[0] : undefined;
return new Promise(function (resolve, reject) {
var result = anObject(call(state.next, state.iterator));
var result = anObject(hasValue ? call(state.next, state.iterator, value) : call(state.next, state.iterator));
asyncFromSyncIteratorContinuation(result, resolve, reject, state.iterator, true);

@@ -51,9 +53,31 @@ });

'return': function () {
var iterator = getInternalState(this).iterator;
var state = getInternalState(this);
var iterator = state.iterator;
var hasValue = arguments.length > 0;
var value = hasValue ? arguments[0] : undefined;
return new Promise(function (resolve, reject) {
var $return = getMethod(iterator, 'return');
if ($return === undefined) return resolve(createIterResultObject(undefined, true));
var result = anObject(call($return, iterator));
if ($return === undefined) return resolve(createIterResultObject(value, true));
var result = anObject(hasValue ? call($return, iterator, value) : call($return, iterator));
asyncFromSyncIteratorContinuation(result, resolve, reject, iterator);
});
},
'throw': function () {
var state = getInternalState(this);
var iterator = state.iterator;
var hasValue = arguments.length > 0;
var value = hasValue ? arguments[0] : undefined;
return new Promise(function (resolve, reject) {
var $throw = getMethod(iterator, 'throw');
if ($throw === undefined) {
try {
iteratorClose(iterator, 'normal');
} catch (error) {
return reject(error);
}
return reject(new TypeError('The iterator does not provide a throw method'));
}
var result = anObject(hasValue ? call($throw, iterator, value) : call($throw, iterator));
asyncFromSyncIteratorContinuation(result, resolve, reject, iterator, true);
});
}

@@ -60,0 +84,0 @@ });

'use strict';
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var getBuiltIn = require('../internals/get-built-in');

@@ -10,11 +11,18 @@ var getMethod = require('../internals/get-method');

if (returnMethod) {
return getBuiltIn('Promise').resolve(call(returnMethod, iterator)).then(function () {
return getBuiltIn('Promise').resolve(call(returnMethod, iterator)).then(function (result) {
try {
if (method !== reject) anObject(result);
} catch (error3) {
reject(error3);
return;
}
method(argument);
}, function (error) {
reject(error);
method === reject ? method(argument) : reject(error);
});
}
} catch (error2) {
return reject(error2);
// the original error (`argument`) takes priority over `return()` errors
return method === reject ? reject(argument) : reject(error2);
} method(argument);
};

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

var createIterResultObject = require('../internals/create-iter-result-object');
var iteratorClose = require('../internals/iterator-close');

@@ -60,23 +59,51 @@ var Promise = getBuiltIn('Promise');

var iterator = state.iterator;
var inner = state.inner;
var returnMethod, result;
var completion = perform(function () {
if (state.inner) try {
iteratorClose(state.inner.iterator, 'normal');
} catch (error) {
return iteratorClose(iterator, 'throw', error);
var closeOuterIterator = function () {
var completion = perform(function () {
return getMethod(iterator, 'return');
});
returnMethod = result = completion.value;
if (completion.error) return Promise.reject(result);
if (returnMethod === undefined) return Promise.resolve(createIterResultObject(undefined, true));
completion = perform(function () {
return call(returnMethod, iterator);
});
result = completion.value;
if (completion.error) return Promise.reject(result);
return IS_ITERATOR ? Promise.resolve(result) : Promise.resolve(result).then(function (resolved) {
anObject(resolved);
return createIterResultObject(undefined, true);
});
};
var closeAndReject = function (error) {
return closeOuterIterator().then(function () {
throw error;
}, function () {
throw error;
});
};
if (inner) {
var innerIterator = inner.iterator;
var innerReturn;
var completion = perform(function () {
innerReturn = getMethod(innerIterator, 'return');
if (innerReturn) return call(innerReturn, innerIterator);
});
if (completion.error) return closeAndReject(completion.value);
if (innerReturn) {
return Promise.resolve(completion.value).then(function (innerResult) {
try {
anObject(innerResult);
} catch (error) {
return closeAndReject(error);
}
return closeOuterIterator();
}, closeAndReject);
}
return getMethod(iterator, 'return');
});
returnMethod = result = completion.value;
if (completion.error) return Promise.reject(result);
if (returnMethod === undefined) return Promise.resolve(createIterResultObject(undefined, true));
completion = perform(function () {
return call(returnMethod, iterator);
});
result = completion.value;
if (completion.error) return Promise.reject(result);
return IS_ITERATOR ? Promise.resolve(result) : Promise.resolve(result).then(function (resolved) {
anObject(resolved);
return createIterResultObject(undefined, true);
});
}
return closeOuterIterator();
}

@@ -83,0 +110,0 @@ });

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

try {
if (MAPPING) try {
try {
doesNotExceedSafeInteger(counter);
} catch (error5) { ifAbruptCloseAsyncIterator(error5); }
} catch (error5) {
return ifAbruptCloseAsyncIterator(error5);
}
Promise.resolve(anObject(call(next, iterator))).then(function (step) {

@@ -52,3 +54,4 @@ try {

if (MAPPING) {
var result = fn(value, counter);
var index = counter++;
var result = fn(value, index);

@@ -62,3 +65,3 @@ var handler = function ($result) {

try {
createProperty(target, counter++, $result);
createProperty(target, index, $result);
loop();

@@ -65,0 +68,0 @@ } catch (error4) { ifAbruptCloseAsyncIterator(error4); }

@@ -26,22 +26,24 @@ 'use strict';

Promise.resolve(anObject(call(state.next, iterator))).then(function (step) {
try {
if (anObject(step).done) {
state.done = true;
resolve(createIterResultObject(undefined, true));
} else {
var value = step.value;
try {
var result = mapper(value, state.counter++);
try {
Promise.resolve(anObject(call(state.next, iterator))).then(function (step) {
try {
if (anObject(step).done) {
state.done = true;
resolve(createIterResultObject(undefined, true));
} else {
var value = step.value;
try {
var result = mapper(value, state.counter++);
var handler = function (mapped) {
resolve(createIterResultObject(mapped, false));
};
var handler = function (mapped) {
resolve(createIterResultObject(mapped, false));
};
if (isObject(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator);
else handler(result);
} catch (error2) { ifAbruptCloseAsyncIterator(error2); }
}
} catch (error) { doneAndReject(error); }
}, doneAndReject);
if (isObject(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator);
else handler(result);
} catch (error2) { ifAbruptCloseAsyncIterator(error2); }
}
} catch (error) { doneAndReject(error); }
}, doneAndReject);
} catch (error) { doneAndReject(error); }
});

@@ -48,0 +50,0 @@ });

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

module.exports = function (it) {
if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');
return it;
};
'use strict';
var userAgent = require('../internals/environment-user-agent');
// eslint-disable-next-line redos/no-vulnerable -- safe
module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
module.exports = /ipad|iphone|ipod/i.test(userAgent) && /applewebkit/i.test(userAgent);

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

// eslint-disable-next-line es/no-function-prototype-bind -- safe
var test = (function () { /* empty */ }).bind();
var test = function () { /* empty */ }.bind();
// eslint-disable-next-line no-prototype-builtins -- safe
return typeof test != 'function' || test.hasOwnProperty('prototype');
});

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

// additional protection from minified / mangled / dropped function names
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));

@@ -14,0 +14,0 @@

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

var stop = function (condition) {
if (iterator) iteratorClose(iterator, 'normal');
var $iterator = iterator;
iterator = undefined;
if ($iterator) iteratorClose($iterator, 'normal');
return new Result(true, condition);

@@ -63,6 +65,9 @@ };

while (!(step = call(next, iterator)).done) {
// `IteratorValue` errors should propagate without closing the iterator
var value = step.value;
try {
result = callFn(step.value);
result = callFn(value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
if (iterator) iteratorClose(iterator, 'throw', error);
else throw error;
}

@@ -69,0 +74,0 @@ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;

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

var iterator = state.iterator;
var done = state.done;
state.done = true;

@@ -49,2 +50,3 @@ if (IS_ITERATOR) {

}
if (done) return createIterResultObject(undefined, true);
if (state.inner) try {

@@ -58,3 +60,4 @@ iteratorClose(state.inner.iterator, NORMAL);

} catch (error) {
return iteratorClose(iterator, THROW, error);
if (iterator) return iteratorClose(iterator, THROW, error);
throw error;
}

@@ -61,0 +64,0 @@ if (iterator) iteratorClose(iterator, NORMAL);

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

done = this.done = !!result.done;
if (allowPartial && done && buffer.length && buffer.length < windowSize) return createIterResultObject(buffer, false);
if (allowPartial && done && buffer.length && buffer.length < windowSize) return createIterResultObject(slice(buffer, 0), false);
if (done) return createIterResultObject(undefined, true);

@@ -32,3 +32,3 @@

push(buffer, result.value);
if (buffer.length === windowSize) return createIterResultObject(buffer, false);
if (buffer.length === windowSize) return createIterResultObject(slice(buffer, 0), false);
}

@@ -35,0 +35,0 @@ }, false, true);

'use strict';
var call = require('../internals/function-call');
var uncurryThis = require('../internals/function-uncurry-this');
var anObject = require('../internals/an-object');
var createIteratorProxy = require('../internals/iterator-create-proxy');

@@ -34,3 +35,3 @@ var iteratorCloseAll = require('../internals/iterator-close-all');

try {
result = call(iter.next, iter.iterator);
result = anObject(call(iter.next, iter.iterator));
done = result.done;

@@ -58,3 +59,3 @@ result = result.value;

try {
open = call(iters[k].next, iters[k].iterator);
open = anObject(call(iters[k].next, iters[k].iterator));
openDone = open.done;

@@ -64,3 +65,3 @@ open = open.value;

openIters[k] = undefined;
return iteratorCloseAll(openIters, THROW, open);
return iteratorCloseAll(openIters, THROW, error);
}

@@ -67,0 +68,0 @@ // eslint-disable-next-line max-depth -- specification case

'use strict';
// https://github.com/tc39/proposal-iterator.range
var InternalStateModule = require('../internals/internal-state');

@@ -20,2 +21,6 @@ var createIteratorConstructor = require('../internals/iterator-create-constructor');

var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(start, end, option, type, zero, one) {
// eslint-disable-next-line no-self-compare -- NaN check
if (start !== start || end !== end) {
throw new $RangeError(INCORRECT_RANGE);
}
// TODO: Drop the first `typeof` check after removing legacy methods in `core-js@4`

@@ -31,3 +36,3 @@ if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) {

var step;
if (option === undefined) {
if (isNullOrUndefined(option)) {
step = undefined;

@@ -48,7 +53,7 @@ } else if (isObject(option)) {

}
if (step === Infinity || step === -Infinity || (step === zero && start !== end)) {
// eslint-disable-next-line no-self-compare -- NaN check
if (step !== step || step === Infinity || step === -Infinity || (step === zero && start !== end)) {
throw new $RangeError(INCORRECT_RANGE);
}
// eslint-disable-next-line no-self-compare -- NaN check
var hitsEnd = start !== start || end !== end || step !== step || (end > start) !== (step > zero);
var hitsEnd = end > start !== step > zero;
setInternalState(this, {

@@ -55,0 +60,0 @@ type: NUMERIC_RANGE_ITERATOR,

@@ -38,2 +38,10 @@ 'use strict';

var setGroups = function (re, groups) {
var object = re.groups = create(null);
for (var i = 0; i < groups.length; i++) {
var group = groups[i];
object[group[0]] = re[group[1]];
}
};
if (PATCH) {

@@ -45,3 +53,3 @@ patchedExec = function exec(string) {

var raw = state.raw;
var result, reCopy, lastIndex, match, i, object, group;
var result, reCopy, lastIndex;

@@ -52,2 +60,5 @@ if (raw) {

re.lastIndex = raw.lastIndex;
if (result && state.groups) setGroups(result, state.groups);
return result;

@@ -71,4 +82,6 @@ }

// Support anchored sticky behavior.
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt(str, re.lastIndex - 1) !== '\n')) {
source = '(?: ' + source + ')';
var prevChar = re.lastIndex > 0 && charAt(str, re.lastIndex - 1);
if (re.lastIndex > 0 &&
(!re.multiline || re.multiline && prevChar !== '\n' && prevChar !== '\r' && prevChar !== '\u2028' && prevChar !== '\u2029')) {
source = '(?: (?:' + source + '))';
strCopy = ' ' + strCopy;

@@ -87,7 +100,7 @@ charsAdded++;

match = call(nativeExec, sticky ? reCopy : re, strCopy);
var match = call(nativeExec, sticky ? reCopy : re, strCopy);
if (sticky) {
if (match) {
match.input = stringSlice(match.input, charsAdded);
match.input = str;
match[0] = stringSlice(match[0], charsAdded);

@@ -104,3 +117,3 @@ match.index = re.lastIndex;

call(nativeReplace, match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;

@@ -111,9 +124,3 @@ }

if (match && groups) {
match.groups = object = create(null);
for (i = 0; i < groups.length; i++) {
group = groups[i];
object[group[0]] = match[group[1]];
}
}
if (match && groups) setGroups(match, groups);

@@ -120,0 +127,0 @@ return match;

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

var result = clone(O);
if (size(O) <= otherRec.size) iterateSet(O, function (e) {
if (size(result) <= otherRec.size) iterateSet(result, function (e) {
if (otherRec.includes(e)) remove(result, e);

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

@@ -20,4 +20,4 @@ 'use strict';

return iterateSimple(iterator, function (e) {
if (has(O, e)) return iteratorClose(iterator, 'normal', false);
if (has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
}) !== false;
};

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

return iterateSimple(iterator, function (e) {
if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
if (!has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
}) !== false;
};

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

(store.versions || (store.versions = [])).push({
version: '3.48.0',
version: '3.49.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
license: 'https://github.com/zloirock/core-js/blob/v3.48.0/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});

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

var stringLength = S.length;
if (intMaxLength <= stringLength) return S;
var fillStr = fillString === undefined ? ' ' : toString(fillString);
var fillLen, stringFiller;
if (intMaxLength <= stringLength || fillStr === '') return S;
if (fillStr === '') return S;
fillLen = intMaxLength - stringLength;

@@ -23,0 +24,0 @@ stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));

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

var parseHex = function (str, index, end) {
if (end >= str.length) return -1;
if (end > str.length || index >= end) return -1;
var n = 0;

@@ -29,0 +29,0 @@ for (; index < end; index++) {

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

var $RangeError = RangeError;
var floor = Math.floor;

@@ -16,4 +17,4 @@ // `String.prototype.repeat` method implementation

if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
for (;n > 0; (n = floor(n / 2)) && (str += str)) if (n % 2) result += str;
return result;
};
'use strict';
var round = Math.round;
var floor = Math.floor;
// https://tc39.es/ecma262/#sec-touint8clamp
module.exports = function (it) {
var value = round(it);
return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
var number = +it;
// eslint-disable-next-line no-self-compare -- NaN check
if (number !== number || number <= 0) return 0;
if (number >= 0xFF) return 0xFF;
var f = floor(number);
if (f + 0.5 < number) return f + 1;
if (number < f + 0.5) return f;
// round-half-to-even (banker's rounding)
return f % 2 === 0 ? f : f + 1;
};

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

var isIntegralNumber = require('../internals/is-integral-number');
var toLength = require('../internals/to-length');
var toIndex = require('../internals/to-index');

@@ -166,3 +165,3 @@ var toOffset = require('../internals/to-offset');

} else {
byteLength = toLength($length) * BYTES;
byteLength = toIndex($length) * BYTES;
if (byteLength + byteOffset > $len) throw new RangeError(WRONG_LENGTH);

@@ -169,0 +168,0 @@ }

'use strict';
var bind = require('../internals/function-bind-context');
var call = require('../internals/function-call');
var aCallable = require('../internals/a-callable');
var aConstructor = require('../internals/a-constructor');

@@ -16,6 +17,7 @@ var toObject = require('../internals/to-object');

var C = aConstructor(this);
var O = toObject(source);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
if (mapping) aCallable(mapfn);
var O = toObject(source);
var iteratorMethod = getIteratorMethod(O);

@@ -22,0 +24,0 @@ var i, length, result, thisIsBigIntArray, value, step, iterator, next;

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

var SyntaxError = globalThis.SyntaxError;
var parseInt = globalThis.parseInt;
var min = Math.min;
var NOT_HEX = /[^\da-f]/i;
var exec = uncurryThis(NOT_HEX.exec);
var stringSlice = uncurryThis(''.slice);
var stringMatch = uncurryThis(''.match);

@@ -19,10 +16,13 @@ module.exports = function (string, into) {

var bytes = into || new Uint8Array(maxLength);
var read = 0;
var segments = stringMatch(string, /.{2}/g);
var written = 0;
while (written < maxLength) {
var hexits = stringSlice(string, read, read += 2);
if (exec(NOT_HEX, hexits)) throw new SyntaxError('String should only contain hex characters');
bytes[written++] = parseInt(hexits, 16);
for (; written < maxLength; written++) {
var result = +('0x' + segments[written] + '0');
// eslint-disable-next-line no-self-compare -- NaN check
if (result !== result) {
throw new SyntaxError('String should only contain hex characters');
}
bytes[written] = result >> 4;
}
return { bytes: bytes, read: read };
return { bytes: bytes, read: written << 1 };
};

@@ -16,6 +16,7 @@ 'use strict';

var sourceLen = lengthOfArrayLike(O);
var depthNum = depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg);
var A = arraySpeciesCreate(O, 0);
flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toIntegerOrInfinity(depthArg));
flattenIntoArray(A, O, O, sourceLen, 0, depthNum);
return A;
}
});

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

// `Array.fromAsync` method
// https://github.com/tc39/proposal-array-from-async
// https://tc39.es/ecma262/#sec-array.fromasync
$({ target: 'Array', stat: true, forced: INCORRECT_CONSTRUCTURING }, {
fromAsync: fromAsync
});

@@ -13,5 +13,11 @@ 'use strict';

// Safari 26.4- bug
var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
// eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
return [, 1].includes(undefined, 1);
});
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
includes: function includes(el /* , fromIndex = 0 */) {

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

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

if (comparefn !== undefined) return +comparefn(x, y) || 0;
return toString(x) > toString(y) ? 1 : -1;
var xString = toString(x);
var yString = toString(y);
return xString === yString ? 0 : xString > yString ? 1 : -1;
};

@@ -77,0 +79,0 @@ };

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

var significand = bytes & SIGNIFICAND_MASK16;
if (exponent === EXP_MASK16) return significand === 0 ? (sign === 0 ? Infinity : -Infinity) : NaN;
if (exponent === EXP_MASK16) return significand === 0 ? sign === 0 ? Infinity : -Infinity : NaN;
if (exponent === 0) return significand * (sign === 0 ? MIN_SUBNORMAL16 : -MIN_SUBNORMAL16);

@@ -19,0 +19,0 @@ return pow(2, exponent - 15) * (sign === 0 ? 1 + significand * SIGNIFICAND_DENOM16 : -1 - significand * SIGNIFICAND_DENOM16);

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

var floor = Math.floor;
var pow = Math.pow;

@@ -29,3 +30,3 @@

// normal
var exponent = log2(value) | 0;
var exponent = floor(log2(value));
if (exponent === -15) {

@@ -32,0 +33,0 @@ // we round from a value between 2 ** -15 * (1 + 1022/1024) (the largest subnormal) and 2 ** -14 * (1 + 0/1024) (the smallest normal)

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

thisTimeValue(this);
var yi = toIntegerOrInfinity(year);
var y = +year;
// eslint-disable-next-line no-self-compare -- NaN check
if (y !== y) return setFullYear(this, y);
var yi = toIntegerOrInfinity(y);
var yyyy = yi >= 0 && yi <= 99 ? yi + 1900 : yi;

@@ -19,0 +22,0 @@ return setFullYear(this, yyyy);

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

// eslint-disable-next-line es/no-object-setprototypeof, no-proto -- safe
var PROTOTYPE_SETTING_AVAILABLE = Object.setPrototypeOf || ({}).__proto__;
var PROTOTYPE_SETTING_AVAILABLE = Object.setPrototypeOf || {}.__proto__;

@@ -14,0 +14,0 @@ var DOMException = getBuiltIn(DOM_EXCEPTION);

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

if (code < 256) {
result += '%' + hex(code, 2);
result += '%' + toUpperCase(hex(code, 2));
} else {

@@ -39,0 +39,0 @@ result += '%u' + toUpperCase(hex(code, 4));

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

var createIteratorProxy = require('../internals/iterator-create-proxy');
var IS_PURE = require('../internals/is-pure');

@@ -24,3 +25,3 @@ var $Array = Array;

this.iterables[iterableIndex] = null;
iterator = this.iterator = call(entry.method, entry.iterable);
iterator = this.iterator = anObject(call(entry.method, entry.iterable));
this.next = iterator.next;

@@ -39,4 +40,4 @@ }

// `Iterator.concat` method
// https://github.com/tc39/proposal-iterator-sequencing
$({ target: 'Iterator', stat: true }, {
// https://tc39.es/ecma262/#sec-iterator.concat
$({ target: 'Iterator', stat: true, forced: IS_PURE }, {
concat: function concat() {

@@ -43,0 +44,0 @@ var length = arguments.length;

@@ -10,7 +10,12 @@ 'use strict';

var iteratorClose = require('../internals/iterator-close');
var iteratorHelperThrowsOnInvalidIterator = require('../internals/iterator-helper-throws-on-invalid-iterator');
var iteratorHelperWithoutClosingOnEarlyError = require('../internals/iterator-helper-without-closing-on-early-error');
var IS_PURE = require('../internals/is-pure');
var takeWithoutClosingOnEarlyError = !IS_PURE && iteratorHelperWithoutClosingOnEarlyError('take', RangeError);
var TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('take', 1);
var takeWithoutClosingOnEarlyError = !IS_PURE && !TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR
&& iteratorHelperWithoutClosingOnEarlyError('take', RangeError);
var FORCED = IS_PURE || TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR || takeWithoutClosingOnEarlyError;
var IteratorProxy = createIteratorProxy(function () {

@@ -29,3 +34,3 @@ var iterator = this.iterator;

// https://tc39.es/ecma262/#sec-iterator.prototype.take
$({ target: 'Iterator', proto: true, real: true, forced: IS_PURE || takeWithoutClosingOnEarlyError }, {
$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
take: function take(limit) {

@@ -32,0 +37,0 @@ anObject(this);

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

var nodes = {};
var closed = false;
while (i < source.length) {

@@ -138,2 +139,3 @@ i = this.until(['"', '}'], i);

i++;
closed = true;
break;

@@ -158,5 +160,7 @@ }

i++;
closed = true;
break;
}
}
if (!closed) throw new SyntaxError('Unterminated object at: ' + i);
return this.node(OBJECT, object, this.index, i, nodes);

@@ -170,2 +174,3 @@ },

var nodes = [];
var closed = false;
while (i < source.length) {

@@ -175,2 +180,3 @@ i = this.skip(IS_WHITESPACE, i);

i++;
closed = true;
break;

@@ -187,5 +193,7 @@ }

i++;
closed = true;
break;
}
}
if (!closed) throw new SyntaxError('Unterminated array at: ' + i);
return this.node(OBJECT, array, this.index, i, nodes);

@@ -206,3 +214,7 @@ },

else throw new SyntaxError('Failed to parse number at: ' + i);
if (at(source, i) === '.') i = this.skip(IS_DIGIT, i + 1);
if (at(source, i) === '.') {
var fractionStartIndex = i + 1;
i = this.skip(IS_DIGIT, fractionStartIndex);
if (fractionStartIndex === i) throw new SyntaxError("Failed to parse number's fraction at: " + i);
}
if (at(source, i) === 'e' || at(source, i) === 'E') {

@@ -209,0 +221,0 @@ i++;

@@ -31,4 +31,4 @@ 'use strict';

var surrogates = /[\uD800-\uDFFF]/g;
var lowSurrogates = /^[\uD800-\uDBFF]$/;
var hiSurrogates = /^[\uDC00-\uDFFF]$/;
var leadingSurrogates = /^[\uD800-\uDBFF]$/;
var trailingSurrogates = /^[\uDC00-\uDFFF]$/;

@@ -69,3 +69,6 @@ var MARK = uid();

var next = charAt(string, offset + 1);
if ((exec(lowSurrogates, match) && !exec(hiSurrogates, next)) || (exec(hiSurrogates, match) && !exec(lowSurrogates, prev))) {
if (
(exec(leadingSurrogates, match) && !exec(trailingSurrogates, next)) ||
(exec(trailingSurrogates, match) && !exec(leadingSurrogates, prev))
) {
return '\\u' + numberToString(charCodeAt(match, 0), 16);

@@ -72,0 +75,0 @@ } return match;

'use strict';
var $ = require('../internals/export');
var aCallable = require('../internals/a-callable');
var aMap = require('../internals/a-map');
var MapHelpers = require('../internals/map-helpers');

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

// `Map.prototype.getOrInsertComputed` method
// https://github.com/tc39/proposal-upsert
// https://tc39.es/ecma262/#sec-map.prototype.getorinsertcomputed
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
aMap(this);
var hasKey = has(this, key);
aCallable(callbackfn);
if (has(this, key)) return get(this, key);
if (hasKey) return get(this, key);
// CanonicalizeKeyedCollectionKey

@@ -21,0 +20,0 @@ if (key === 0 && 1 / key === -Infinity) key = 0;

'use strict';
var $ = require('../internals/export');
var aMap = require('../internals/a-map');
var MapHelpers = require('../internals/map-helpers');

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

// `Map.prototype.getOrInsert` method
// https://github.com/tc39/proposal-upsert
// https://tc39.es/ecma262/#sec-map.prototype.getorinsert
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
getOrInsert: function getOrInsert(key, value) {
if (has(aMap(this), key)) return get(this, key);
if (has(this, key)) return get(this, key);
set(this, key, value);

@@ -18,0 +17,0 @@ return value;

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

var sqrt = Math.sqrt;
var LN2 = Math.LN2;
// sqrt(2 ** 53) - prevent n * n overflow
var SQRT_2_POW_53 = 94906265.62425156;
function asinh(x) {
var n = +x;
return !isFinite(n) || n === 0 ? n : n < 0 ? -asinh(-n) : log(n + sqrt(n * n + 1));
return !isFinite(n) || n === 0 ? n : n < 0 ? -asinh(-n) : n > SQRT_2_POW_53 ? log(n) + LN2 : log(n + sqrt(n * n + 1));
}

@@ -14,0 +17,0 @@

'use strict';
var $ = require('../internals/export');
var log1p = require('../internals/math-log1p');
// eslint-disable-next-line es/no-math-atanh -- required for testing
var $atanh = Math.atanh;
var log = Math.log;

@@ -16,4 +16,4 @@ var FORCED = !($atanh && 1 / $atanh(-0) < 0);

var n = +x;
return n === 0 ? n : log((1 + n) / (1 - n)) / 2;
return n === 0 ? n : log1p(2 * n / (1 - n)) / 2;
}
});

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

var POW_2_1023 = pow(2, 1023);
var MAX_SAFE_INTEGER = pow(2, 53) - 1; // 2 ** 53 - 1 === 9007199254740992
var MAX_SAFE_INTEGER = pow(2, 53) - 1; // 2 ** 53 - 1 === 9007199254740991
var MAX_DOUBLE = Number.MAX_VALUE; // 2 ** 1024 - 2 ** (1023 - 52) === 1.79769313486231570815e+308

@@ -36,3 +36,3 @@ var MAX_ULP = pow(2, 971); // 2 ** (1023 - 52) === 1.99584030953471981166e+292

// `Math.sumPrecise` method
// https://github.com/tc39/proposal-math-sum
// https://tc39.es/ecma262/#sec-math.sumprecise
$({ target: 'Math', stat: true }, {

@@ -46,3 +46,3 @@ // eslint-disable-next-line max-statements -- ok

iterate(items, function (n) {
if (++count >= MAX_SAFE_INTEGER) throw new $RangeError('Maximum allowed index exceeded');
if (++count > MAX_SAFE_INTEGER) throw new $RangeError('Maximum allowed index exceeded');
if (typeof n != 'number') throw new $TypeError('Value is not a number');

@@ -49,0 +49,0 @@ if (state !== NOT_A_NUMBER) {

@@ -21,2 +21,4 @@ 'use strict';

var POW_10_308 = pow(10, 308);
// Edge 17-

@@ -62,3 +64,3 @@ var ROUNDS_PROPERLY = nativeToExponential(-6.9e-11, 4) === '-6.9000e-11'

var s = '';
var m, e, c, d;
var m, e, c, d, l, n, xScaled;
if (x < 0) {

@@ -72,9 +74,16 @@ s = '-';

} else {
// this block is based on https://gist.github.com/SheetJSDev/1100ad56b9f856c95299ed0e068eea08
// TODO: improve accuracy with big fraction digits
var l = log10(x);
l = log10(x);
e = floor(l);
var w = pow(10, e - f);
var n = round(x / w);
if (2 * x >= (2 * n + 1) * w) {
// compute x / pow(10, e - f) and round, avoiding underflow/overflow
if (f - e >= 308) {
// pow(10, e - f) would underflow to a subnormal or zero; split computation
xScaled = x * POW_10_308 * pow(10, f - e - 308);
} else {
xScaled = x / pow(10, e - f);
}
n = round(xScaled);
// correct tie-breaking: round half up
// avoids `2 * x` overflow for values near MAX_VALUE
if (xScaled - n >= 0.5) {
n += 1;

@@ -81,0 +90,0 @@ }

@@ -34,4 +34,4 @@ 'use strict';

aConstructor(Target);
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);

@@ -38,0 +38,0 @@ if (Target === newTarget) {

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

var definePropertyModule = require('../internals/object-define-property');
var isCallable = require('../internals/is-callable');
var fails = require('../internals/fails');
var $TypeError = TypeError;
// MS Edge has broken Reflect.defineProperty - throwing instead of returning false

@@ -22,3 +25,10 @@ var ERROR_INSTEAD_OF_FALSE = fails(function () {

var key = toPropertyKey(propertyKey);
var get, set;
anObject(attributes);
// propagate `ToPropertyDescriptor` errors instead of catching them
if (('get' in attributes || 'set' in attributes) && (
('get' in attributes && !isCallable(get = attributes.get) && get !== undefined) ||
('set' in attributes && !isCallable(set = attributes.set) && set !== undefined) ||
('value' in attributes || 'writable' in attributes)
)) throw new $TypeError('Invalid property descriptor');
try {

@@ -25,0 +35,0 @@ definePropertyModule.f(target, key, attributes);

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

var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var toPropertyKey = require('../internals/to-property-key');

@@ -11,5 +12,7 @@ // `Reflect.deleteProperty` method

deleteProperty: function deleteProperty(target, propertyKey) {
var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
anObject(target);
var key = toPropertyKey(propertyKey);
var descriptor = getOwnPropertyDescriptor(target, key);
return descriptor && !descriptor.configurable ? false : delete target[key];
}
});

@@ -9,18 +9,20 @@ 'use strict';

var getPrototypeOf = require('../internals/object-get-prototype-of');
var toPropertyKey = require('../internals/to-property-key');
// `Reflect.get` method
// https://tc39.es/ecma262/#sec-reflect.get
function get(target, propertyKey /* , receiver */) {
var receiver = arguments.length < 3 ? target : arguments[2];
var descriptor, prototype;
var $get = function (target, propertyKey, receiver) {
if (anObject(target) === receiver) return target[propertyKey];
descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
var descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
if (descriptor) return isDataDescriptor(descriptor)
? descriptor.value
: descriptor.get === undefined ? undefined : call(descriptor.get, receiver);
if (isObject(prototype = getPrototypeOf(target))) return get(prototype, propertyKey, receiver);
}
var prototype = getPrototypeOf(target);
if (isObject(prototype)) return $get(prototype, propertyKey, receiver);
};
$({ target: 'Reflect', stat: true }, {
get: get
get: function get(target, propertyKey /* , receiver */) {
return $get(anObject(target), toPropertyKey(propertyKey), arguments.length < 3 ? target : arguments[2]);
}
});

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

var createPropertyDescriptor = require('../internals/create-property-descriptor');
var toPropertyKey = require('../internals/to-property-key');
// `Reflect.set` method
// https://tc39.es/ecma262/#sec-reflect.set
function set(target, propertyKey, V /* , receiver */) {
var receiver = arguments.length < 4 ? target : arguments[3];
var $set = function (target, propertyKey, V, receiver) {
var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);

@@ -22,3 +22,3 @@ var existingDescriptor, prototype, setter;

if (isObject(prototype = getPrototypeOf(target))) {
return set(prototype, propertyKey, V, receiver);
return $set(prototype, propertyKey, V, receiver);
}

@@ -30,6 +30,9 @@ ownDescriptor = createPropertyDescriptor(0);

if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
existingDescriptor.value = V;
definePropertyModule.f(receiver, propertyKey, existingDescriptor);
} else definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));
if (!isDataDescriptor(existingDescriptor) || existingDescriptor.writable === false) return false;
definePropertyModule.f(receiver, propertyKey, { value: V });
} else try {
definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V));
} catch (error) {
return false;
}
} else {

@@ -40,3 +43,3 @@ setter = ownDescriptor.set;

} return true;
}
};

@@ -53,3 +56,5 @@ // MS Edge 17-18 Reflect.set allows setting the property to object

$({ target: 'Reflect', stat: true, forced: MS_EDGE_BUG }, {
set: set
set: function set(target, propertyKey, V /* , receiver */) {
return $set(anObject(target), toPropertyKey(propertyKey), V, arguments.length < 4 ? target : arguments[3]);
}
});

@@ -92,2 +92,7 @@ 'use strict';

chr += charAt(string, ++index);
// use `\x5c` for escaped backslash to avoid corruption by `\k<name>` to `\N` replacement below
if (!ncg && charAt(chr, 1) === '\\') {
result += '\\x5c';
continue;
}
} else if (chr === ']') {

@@ -101,11 +106,9 @@ brackets = false;

result += chr;
// ignore non-capturing groups
if (stringSlice(string, index + 1, index + 3) === '?:') {
continue;
}
if (exec(IS_NCG, stringSlice(string, index + 1))) {
index += 2;
ncg = true;
groupid++;
} else if (charAt(string, index + 1) !== '?') {
groupid++;
}
groupid++;
continue;

@@ -124,2 +127,10 @@ case chr === '>' && ncg:

else result += chr;
}
// convert `\k<name>` backreferences to numbered backreferences
for (var ni = 0; ni < named.length; ni++) {
var backref = '\\k<' + named[ni][0] + '>';
var numRef = '\\' + named[ni][1];
while (stringIndexOf(result, backref) > -1) {
result = replace(result, backref, numRef);
}
} return [result, named];

@@ -126,0 +137,0 @@ };

@@ -28,8 +28,8 @@ 'use strict';

notARegExp(searchString);
var search = toString(searchString);
var endPosition = arguments.length > 1 ? arguments[1] : undefined;
var len = that.length;
var end = endPosition === undefined ? len : min(toLength(endPosition), len);
var search = toString(searchString);
return slice(that, end - search.length, end) === search;
}
});

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

while (length > i) {
code = +arguments[i++];
code = +arguments[i];
if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw new $RangeError(code + ' is not a valid code point');
elements[i] = code < 0x10000
elements[i++] = code < 0x10000
? fromCharCode(code)

@@ -30,0 +30,0 @@ : fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);

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

$global = !!~stringIndexOf(flags, 'g');
fullUnicode = !!~stringIndexOf(flags, 'u');
fullUnicode = !!~stringIndexOf(flags, 'u') || !!~stringIndexOf(flags, 'v');
matcher.lastIndex = toLength(R.lastIndex);

@@ -78,0 +78,0 @@ return new $RegExpStringIterator(matcher, S, $global, fullUnicode);

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

if (stringIndexOf(flags, 'g') === -1) return regExpExec(rx, S);
if (!~stringIndexOf(flags, 'g')) return regExpExec(rx, S);
var fullUnicode = stringIndexOf(flags, 'u') !== -1;
var fullUnicode = !!~stringIndexOf(flags, 'u') || !!~stringIndexOf(flags, 'v');
rx.lastIndex = 0;

@@ -43,0 +43,0 @@ var A = [];

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

var functionalReplace = isCallable(replaceValue);
if (!functionalReplace) replaceValue = toString(replaceValue);
var flags = toString(getRegExpFlags(rx));
if (
typeof replaceValue == 'string' &&
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
stringIndexOf(replaceValue, '$<') === -1
!~stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) &&
!~stringIndexOf(replaceValue, '$<') &&
!~stringIndexOf(flags, 'y')
) {

@@ -89,10 +94,6 @@ var res = maybeCallNative(nativeReplace, rx, S, replaceValue);

var functionalReplace = isCallable(replaceValue);
if (!functionalReplace) replaceValue = toString(replaceValue);
var flags = toString(getRegExpFlags(rx));
var global = stringIndexOf(flags, 'g') !== -1;
var global = !!~stringIndexOf(flags, 'g');
var fullUnicode;
if (global) {
fullUnicode = stringIndexOf(flags, 'u') !== -1;
fullUnicode = !!~stringIndexOf(flags, 'u') || !!~stringIndexOf(flags, 'v');
rx.lastIndex = 0;

@@ -99,0 +100,0 @@ }

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

var getMethod = require('../internals/get-method');
var getRegExpFlags = require('../internals/regexp-get-flags');
var regExpExec = require('../internals/regexp-exec-abstract');

@@ -23,2 +24,3 @@ var stickyHelpers = require('../internals/regexp-sticky-helpers');

var stringSlice = uncurryThis(''.slice);
var stringIndexOf = uncurryThis(''.indexOf);

@@ -76,7 +78,7 @@ // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec

var C = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? 'i' : '') +
(rx.multiline ? 'm' : '') +
(rx.unicode ? 'u' : '') +
(UNSUPPORTED_Y ? 'g' : 'y');
var flags = toString(getRegExpFlags(rx));
var unicodeMatching = !!~stringIndexOf(flags, 'u') || !!~stringIndexOf(flags, 'v');
if (UNSUPPORTED_Y) {
if (!~stringIndexOf(flags, 'g')) flags += 'g';
} else if (!~stringIndexOf(flags, 'y')) flags += 'y';
// ^(? + rx + ) is needed, in combination with some S slicing, to

@@ -83,0 +85,0 @@ // simulate the 'y' flag.

@@ -28,6 +28,6 @@ 'use strict';

notARegExp(searchString);
var search = toString(searchString);
var index = toLength(min(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = toString(searchString);
return stringSlice(that, index, index + search.length) === search;
}
});

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

var intStart = toIntegerOrInfinity(start);
var intLength, intEnd;
if (intStart === Infinity) intStart = 0;
if (intStart < 0) intStart = max(size + intStart, 0);
intLength = length === undefined ? size : toIntegerOrInfinity(length);
if (intLength <= 0 || intLength === Infinity) return '';
intEnd = min(intStart + intLength, size);
return intStart >= intEnd ? '' : stringSlice(that, intStart, intEnd);
var finalStart = intStart < 0 ? max(size + intStart, 0) : min(intStart, size);
var intLength = length === undefined ? size : toIntegerOrInfinity(length);
if (intLength <= 0) return '';
var intEnd = min(finalStart + intLength, size);
return finalStart >= intEnd ? '' : stringSlice(that, finalStart, intEnd);
}
});

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

nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
}
} return O;
};

@@ -100,3 +100,4 @@

if (hasOwn(AllSymbols, key)) {
if (!Attributes.enumerable) {
// first definition - default non-enumerable; redefinition - preserve existing state
if (!('enumerable' in Attributes) ? !hasOwn(O, key) || (hasOwn(O, HIDDEN) && O[HIDDEN][key]) : !Attributes.enumerable) {
if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));

@@ -103,0 +104,0 @@ O[HIDDEN][key] = true;

@@ -7,2 +7,3 @@ // `Symbol.prototype.description` getter

var globalThis = require('../internals/global-this');
var call = require('../internals/function-call');
var uncurryThis = require('../internals/function-uncurry-this');

@@ -37,2 +38,10 @@ var hasOwn = require('../internals/has-own-property');

copyConstructorProperties(SymbolWrapper, NativeSymbol);
// wrap Symbol.for for correct handling of empty string descriptions
var nativeFor = SymbolWrapper['for'];
SymbolWrapper['for'] = { 'for': function (key) {
var stringKey = toString(key);
var symbol = call(nativeFor, this, stringKey);
if (stringKey === '') EmptyStringDescriptionStore[symbol] = true;
return symbol;
} }['for'];
SymbolWrapper.prototype = SymbolPrototype;

@@ -39,0 +48,0 @@ SymbolPrototype.constructor = SymbolWrapper;

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

// eslint-disable-next-line no-self-compare -- NaN check
if (y !== y) return -1;
if (y !== y) return x !== x ? 0 : -1;
// eslint-disable-next-line no-self-compare -- NaN check
if (x !== x) return 1;
if (x === 0 && y === 0) return 1 / x > 0 && 1 / y < 0 ? 1 : -1;
return x > y;
if (x === 0 && y === 0) return 1 / x > 0 ? (1 / y > 0 ? 0 : 1) : (1 / y > 0 ? -1 : 0);
return x > y ? 1 : x < y ? -1 : 0;
};

@@ -62,0 +62,0 @@ };

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

// `Uint8Array.fromBase64` method
// https://github.com/tc39/proposal-arraybuffer-base64
// https://tc39.es/ecma262/#sec-uint8array.frombase64
if (Uint8Array) $({ target: 'Uint8Array', stat: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {

@@ -26,0 +26,0 @@ fromBase64: function fromBase64(string /* , options */) {

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

// `Uint8Array.fromHex` method
// https://github.com/tc39/proposal-arraybuffer-base64
// https://tc39.es/ecma262/#sec-uint8array.fromhex
if (globalThis.Uint8Array) $({ target: 'Uint8Array', stat: true }, {

@@ -11,0 +11,0 @@ fromHex: function fromHex(string) {

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

// `Uint8Array.prototype.setFromBase64` method
// https://github.com/tc39/proposal-arraybuffer-base64
// https://tc39.es/ecma262/#sec-uint8array.prototype.setfrombase64
if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {

@@ -31,0 +31,0 @@ setFromBase64: function setFromBase64(string /* , options */) {

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

// `Uint8Array.prototype.setFromHex` method
// https://github.com/tc39/proposal-arraybuffer-base64
// https://tc39.es/ecma262/#sec-uint8array.prototype.setfromhex
if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true, forced: throwsOnLengthTrackingView() }, {

@@ -26,0 +26,0 @@ setFromHex: function setFromHex(string) {

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

// `Uint8Array.prototype.toBase64` method
// https://github.com/tc39/proposal-arraybuffer-base64
// https://tc39.es/ecma262/#sec-uint8array.prototype.tobase64
if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {

@@ -31,0 +31,0 @@ toBase64: function toBase64(/* options */) {

@@ -9,2 +9,4 @@ 'use strict';

var numberToString = uncurryThis(1.1.toString);
var join = uncurryThis([].join);
var $Array = Array;

@@ -23,3 +25,3 @@ var Uint8Array = globalThis.Uint8Array;

// `Uint8Array.prototype.toHex` method
// https://github.com/tc39/proposal-arraybuffer-base64
// https://tc39.es/ecma262/#sec-uint8array.prototype.tohex
if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {

@@ -29,9 +31,9 @@ toHex: function toHex() {

notDetached(this.buffer);
var result = '';
var result = $Array(this.length);
for (var i = 0, length = this.length; i < length; i++) {
var hex = numberToString(this[i], 16);
result += hex.length === 1 ? '0' + hex : hex;
result[i] = hex.length === 1 ? '0' + hex : hex;
}
return result;
return join(result, '');
}
});

@@ -25,6 +25,6 @@ 'use strict';

// `WeakMap.prototype.getOrInsertComputed` method
// https://github.com/tc39/proposal-upsert
// https://tc39.es/ecma262/#sec-weakmap.prototype.getorinsertcomputed
$({ target: 'WeakMap', proto: true, real: true, forced: FORCED }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
aWeakMap(this);
if (!IS_PURE) aWeakMap(this);
aWeakKey(key);

@@ -31,0 +31,0 @@ aCallable(callbackfn);

'use strict';
var $ = require('../internals/export');
var aWeakMap = require('../internals/a-weak-map');
var WeakMapHelpers = require('../internals/weak-map-helpers');

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

// `WeakMap.prototype.getOrInsert` method
// https://github.com/tc39/proposal-upsert
// https://tc39.es/ecma262/#sec-weakmap.prototype.getorinsert
$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {
getOrInsert: function getOrInsert(key, value) {
if (has(aWeakMap(this), key)) return get(this, key);
if (has(this, key)) return get(this, key);
set(this, key, value);

@@ -18,0 +17,0 @@ return value;

@@ -27,4 +27,4 @@ 'use strict';

var raw = value.raw;
return raw.length === value.length && isFrozenStringArray(raw, false);
return isFrozenStringArray(raw, false) && raw.length === value.length;
}
});

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

accumulator = value;
counter++;
loop();
} else try {
var result = reducer(accumulator, value, counter);
var result = reducer(accumulator, value, counter++);

@@ -57,3 +58,2 @@ var handler = function ($result) {

}
counter++;
} catch (error2) { reject(error2); }

@@ -60,0 +60,0 @@ }, reject);

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

var getIteratorDirect = require('../internals/get-iterator-direct');
var getMethod = require('../internals/get-method');
var notANaN = require('../internals/not-a-nan');

@@ -20,5 +21,6 @@ var toPositiveInteger = require('../internals/to-positive-integer');

state.done = true;
returnMethod = iterator['return'];
returnMethod = getMethod(iterator, 'return');
if (returnMethod !== undefined) {
return Promise.resolve(call(returnMethod, iterator, undefined)).then(function () {
return Promise.resolve(call(returnMethod, iterator)).then(function (result) {
anObject(result);
return resultDone;

@@ -25,0 +27,0 @@ });

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

// `BigInt.range` method
// https://github.com/tc39/proposal-Number.range
// https://github.com/tc39/proposal-iterator.range
// TODO: Remove from `core-js@4`

@@ -10,0 +10,0 @@ if (typeof BigInt == 'function') {

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

// `Iterator.range` method
// https://github.com/tc39/proposal-Number.range
// https://github.com/tc39/proposal-iterator.range
$({ target: 'Iterator', stat: true, forced: true }, {

@@ -12,0 +12,0 @@ range: function range(start, end, option) {

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

var iteratorZip = require('../internals/iterator-zip');
var IS_PURE = require('../internals/is-pure');

@@ -23,3 +24,3 @@ var create = getBuiltIn('Object', 'create');

// https://github.com/tc39/proposal-joint-iteration
$({ target: 'Iterator', stat: true }, {
$({ target: 'Iterator', stat: true, forced: IS_PURE }, {
zipKeyed: function zipKeyed(iterables /* , options */) {

@@ -43,3 +44,3 @@ anObject(iterables);

push(keys, key);
push(iters, getIteratorFlattenable(value, true));
push(iters, getIteratorFlattenable(value, false));
}

@@ -46,0 +47,0 @@ } catch (error) {

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

var iteratorZip = require('../internals/iterator-zip');
var IS_PURE = require('../internals/is-pure');

@@ -21,3 +22,3 @@ var concat = uncurryThis([].concat);

// https://github.com/tc39/proposal-joint-iteration
$({ target: 'Iterator', stat: true }, {
$({ target: 'Iterator', stat: true, forced: IS_PURE }, {
zip: function zip(iterables /* , options */) {

@@ -42,5 +43,5 @@ anObject(iterables);

try {
iter = getIteratorFlattenable(next.value, true);
iter = getIteratorFlattenable(next.value, false);
} catch (error) {
return iteratorCloseAll(concat([inputIter.iterator], iters), THROW, error);
return iteratorCloseAll(concat([inputIter], iters), THROW, error);
}

@@ -47,0 +48,0 @@ push(iters, iter);

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

var pow = Math.pow;
var valid = /^[\d.a-z]+$/;
var valid = /^[0-9a-z]+(\.[0-9a-z]+)?$/;
var charAt = uncurryThis(''.charAt);
var charCodeAt = uncurryThis(''.charCodeAt);
var exec = uncurryThis(valid.exec);

@@ -21,2 +22,18 @@ var numberToString = uncurryThis(1.1.toString);

var validDigitForRadix = function (string, R) {
for (var i = 0; i < string.length; i++) {
var code = charCodeAt(string, i);
// '.' is allowed
if (code === 0x2E) continue;
// '0'-'9' - digit value 0-9
if (code >= 0x30 && code <= 0x39) {
if (code - 0x30 >= R) return false;
// 'a'-'z' - digit value 10-35
} else if (code >= 0x61 && code <= 0x7A) {
if (code - 0x61 + 10 >= R) return false;
} else return false;
}
return true;
};
// `Number.fromString` method

@@ -36,9 +53,19 @@ // https://github.com/tc39/proposal-number-fromstring

if (R < 2 || R > 36) throw new $RangeError(INVALID_RADIX);
if (!exec(valid, string)) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
if (!exec(valid, string) || !validDigitForRadix(string, R)) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
var parts = split(string, '.');
var mathNum = $parseInt(parts[0], R);
if (parts.length > 1) mathNum += $parseInt(parts[1], R) / pow(R, parts[1].length);
if (R === 10 && numberToString(mathNum, R) !== string) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
if (R === 10) {
var compareString = string;
if (parts.length > 1) {
var fraction = parts[1];
while (fraction.length && charAt(fraction, fraction.length - 1) === '0') {
fraction = stringSlice(fraction, 0, -1);
}
compareString = fraction.length ? parts[0] + '.' + fraction : parts[0];
}
if (numberToString(mathNum, R) !== compareString) throw new $SyntaxError(INVALID_NUMBER_REPRESENTATION);
}
return sign * mathNum;
}
});

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

// `Number.range` method
// https://github.com/tc39/proposal-Number.range
// https://github.com/tc39/proposal-iterator.range
// TODO: Remove from `core-js@4`

@@ -9,0 +9,0 @@ $({ target: 'Number', stat: true, forced: true }, {

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

var getIterator = require('../internals/get-iterator');
var getIteratorMethod = require('../internals/get-iterator-method');
var getMethod = require('../internals/get-method');

@@ -27,5 +28,7 @@ var iterate = require('../internals/iterate');

}
var iterator = getIterator(x);
var iteratorMethod = getIteratorMethod(x);
// validate that x is iterable synchronously during `from()` call
if (!iteratorMethod) getIterator(x);
return new C(function (observer) {
iterate(iterator, function (it, stop) {
iterate(getIterator(x, iteratorMethod), function (it, stop) {
observer.next(it);

@@ -32,0 +35,0 @@ if (observer.closed) return stop();

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

}
// eslint-disable-next-line sonarjs/no-redundant-assignments -- false positive, https://github.com/SonarSource/SonarJS/issues/4767
for (var j = 2; j < lines.length; j += 2) {

@@ -92,0 +92,0 @@ var text = lines[j];

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

var $atob = getBuiltIn('atob');
var $Array = Array;
var fromCharCode = String.fromCharCode;
var charAt = uncurryThis(''.charAt);
var replace = uncurryThis(''.replace);
var join = uncurryThis([].join);
var exec = uncurryThis(disallowed.exec);

@@ -51,19 +53,26 @@

var string = replace(toString(data), whitespaces, '');
var output = '';
var position = 0;
var bc = 0;
var length, chr, bs;
if (string.length % 4 === 0) {
if (!(string.length & 3)) {
string = replace(string, finalEq, '');
}
length = string.length;
if (length % 4 === 1 || exec(disallowed, string)) {
var lenmod = length & 3;
if (lenmod === 1 || exec(disallowed, string)) {
throw new (getBuiltIn('DOMException'))('The string is not correctly encoded', 'InvalidCharacterError');
}
// (length >> 2) is equivalent for length / 4 floored; * 3 then multiplies the
// number of bytes for full quanta
// lenmod is length % 4; if there's 2 or 3 bytes it's 1 or 2 bytes of extra output
// respectively, so -1, however use a ternary to ensure 0 does not get -1 onto length
var output = new $Array((length >> 2) * 3 + (lenmod ? lenmod - 1 : 0));
var outputIndex = 0;
while (position < length) {
chr = charAt(string, position++);
bs = bc % 4 ? bs * 64 + c2i[chr] : c2i[chr];
if (bc++ % 4) output += fromCharCode(255 & bs >> (-2 * bc & 6));
} return output;
bs = bc & 3 ? (bs << 6) + c2i[chr] : c2i[chr];
if (bc++ & 3) output[outputIndex++] = fromCharCode(255 & bs >> (-2 * bc & 6));
}
return join(output, '');
}
});

@@ -13,2 +13,4 @@ 'use strict';

var $btoa = getBuiltIn('btoa');
var $Array = Array;
var join = uncurryThis([].join);
var charAt = uncurryThis(''.charAt);

@@ -39,3 +41,8 @@ var charCodeAt = uncurryThis(''.charCodeAt);

var string = toString(data);
var output = '';
// (string.length + 2) / 3) and then truncating to integer
// does the ceil automatically. << 2 will truncate the integer
// while also doing *4. ceil(length / 3) quanta, 4 bytes output
// per quanta for base64.
var output = new $Array((string.length + 2) / 3 << 2);
var outputIndex = 0;
var position = 0;

@@ -50,5 +57,5 @@ var map = i2c;

block = block << 8 | charCode;
output += charAt(map, 63 & block >> 8 - position % 1 * 8);
} return output;
output[outputIndex++] = charAt(map, 63 & block >> 8 - position % 1 * 8);
} return join(output, '');
}
});

@@ -446,4 +446,4 @@ 'use strict';

value = transfer[i++];
type = classof(value);
transferred = undefined;

@@ -504,3 +504,3 @@ if (type === 'ArrayBuffer' ? setHas(buffers, value) : mapHas(map, value)) {

if (PROPER_STRUCTURED_CLONE_TRANSFER) {
nativeRestrictedStructuredClone(buffer, { transfer: [buffer] });
nativeStructuredClone(buffer, { transfer: [buffer] });
} else if (isCallable(buffer.transfer)) {

@@ -507,0 +507,0 @@ buffer.transfer();

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

var codePoint = null;
var length = octets.length;
switch (octets.length) {
switch (length) {
case 1:

@@ -101,5 +102,13 @@ codePoint = octets[0];

return codePoint > 0x10FFFF ? null : codePoint;
// reject surrogates, overlong encodings, and out-of-range codepoints
if (codePoint === null
|| codePoint > 0x10FFFF
|| (codePoint >= 0xD800 && codePoint <= 0xDFFF)
|| codePoint < (length > 3 ? 0x10000 : length > 2 ? 0x800 : length > 1 ? 0x80 : 0)
) return null;
return codePoint;
};
/* eslint-disable max-statements, max-depth -- ok */
var decode = function (input) {

@@ -152,7 +161,11 @@ input = replace(input, plus, ' ');

// eslint-disable-next-line no-self-compare -- NaN check
if (nextByte !== nextByte) {
i += 3;
break;
if (nextByte !== nextByte || nextByte > 191 || nextByte < 128) break;
// https://encoding.spec.whatwg.org/#utf-8-decoder - position-specific byte ranges
if (sequenceIndex === 1) {
if (octet === 0xE0 && nextByte < 0xA0) break;
if (octet === 0xED && nextByte > 0x9F) break;
if (octet === 0xF0 && nextByte < 0x90) break;
if (octet === 0xF4 && nextByte > 0x8F) break;
}
if (nextByte > 191 || nextByte < 128) break;

@@ -171,3 +184,5 @@ push(octets, nextByte);

if (codePoint === null) {
result += FALLBACK_REPLACER;
for (var replacement = 0; replacement < byteSequenceLength; replacement++) result += FALLBACK_REPLACER;
i++;
continue;
} else {

@@ -185,2 +200,3 @@ decodedChar = fromCodePoint(codePoint);

};
/* eslint-enable max-statements, max-depth -- ok */

@@ -338,3 +354,2 @@ var find = /[!'()~]|%20/g;

splice(entries, index, 1);
if (value !== undefined) break;
} else index++;

@@ -389,3 +404,3 @@ }

var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 1);
validateArgumentsLength(arguments.length, 2);
var entries = state.entries;

@@ -455,3 +470,3 @@ var found = false;

// `URLSearchParams.prototype.size` getter
// https://github.com/whatwg/url/pull/734
// https://url.spec.whatwg.org/#dom-urlsearchparams-size
if (DESCRIPTORS) defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {

@@ -458,0 +473,0 @@ get: function size() {

@@ -33,15 +33,12 @@ 'use strict';

var index = 0;
var dindex = 0;
var found = false;
var entriesLength = entries.length;
var entry;
while (index < entriesLength) {
entry = entries[index];
$delete(this, entry.key);
index++;
}
index = 0;
while (index < entriesLength) {
entry = entries[index++];
if (found || entry.key === key) {
found = true;
$delete(this, entry.key);
} else dindex++;
}
while (dindex < entriesLength) {
entry = entries[dindex++];
if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);

@@ -48,0 +45,0 @@ }

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

var TypeError = globalThis.TypeError;
var encodeURIComponent = globalThis.encodeURIComponent;
var parseInt = globalThis.parseInt;

@@ -55,4 +56,3 @@ var floor = Math.floor;

var ALPHA = /[a-z]/i;
// eslint-disable-next-line regexp/no-obscure-range -- safe
var ALPHANUMERIC = /[\d+-.a-z]/i;
var ALPHANUMERIC_PLUS_MINUS_DOT = /[\d+\-.a-z]/i;
var DIGIT = /\d/;

@@ -73,3 +73,20 @@ var HEX_START = /^0x/i;

// https://url.spec.whatwg.org/#ipv4-number-parser
// https://url.spec.whatwg.org/#ends-in-a-number-checker
var endsInNumber = function (input) {
var parts = split(input, '.');
var last, hexPart;
if (parts[parts.length - 1] === '') {
if (parts.length === 1) return false;
parts.length--;
}
last = parts[parts.length - 1];
if (exec(DEC, last)) return true;
if (exec(HEX_START, last)) {
hexPart = stringSlice(last, 2);
return hexPart === '' || !!exec(HEX, hexPart);
}
return false;
};
// https://url.spec.whatwg.org/#concept-ipv4-parser
var parseIPv4 = function (input) {

@@ -82,7 +99,7 @@ var parts = split(input, '.');

partsLength = parts.length;
if (partsLength > 4) return input;
if (partsLength > 4) return null;
numbers = [];
for (index = 0; index < partsLength; index++) {
part = parts[index];
if (part === '') return input;
if (part === '') return null;
radix = 10;

@@ -96,3 +113,3 @@ if (part.length > 1 && charAt(part, 0) === '0') {

} else {
if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return input;
if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return null;
number = parseInt(part, radix);

@@ -251,2 +268,8 @@ }

var C0ControlPercentEncodeSet = {};
var queryPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
' ': 1, '"': 1, '#': 1, '<': 1, '>': 1
});
var specialQueryPercentEncodeSet = assign({}, queryPercentEncodeSet, {
"'": 1
});
var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {

@@ -256,3 +279,3 @@ ' ': 1, '"': 1, '<': 1, '>': 1, '`': 1

var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
'#': 1, '?': 1, '{': 1, '}': 1
'#': 1, '?': 1, '{': 1, '}': 1, '^': 1
});

@@ -265,3 +288,4 @@ var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {

var code = codeAt(chr, 0);
return code > 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : encodeURIComponent(chr);
// encodeURIComponent does not encode ', which is in the special-query percent-encode set
return code >= 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : chr === "'" && hasOwn(set, chr) ? '%27' : encodeURIComponent(chr);
};

@@ -394,3 +418,3 @@

case SCHEME:
if (chr && (exec(ALPHANUMERIC, chr) || chr === '+' || chr === '-' || chr === '.')) {
if (chr && exec(ALPHANUMERIC_PLUS_MINUS_DOT, chr)) {
buffer += toLowerCase(chr);

@@ -401,3 +425,3 @@ } else if (chr === ':') {

(buffer === 'file' && (url.includesCredentials() || url.port !== null)) ||
(url.scheme === 'file' && !url.host)
(url.scheme === 'file' && url.host === '')
)) return;

@@ -498,3 +522,3 @@ url.scheme = buffer;

url.path = arraySlice(base.path);
url.path.length--;
if (url.path.length) url.path.length--;
state = PATH;

@@ -520,3 +544,3 @@ continue;

state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
if (chr !== '/' || charAt(buffer, pointer + 1) !== '/') continue;
if (chr !== '/' || codePoints[pointer + 1] !== '/') continue;
pointer++;

@@ -565,2 +589,3 @@ break;

if (buffer === '') return INVALID_HOST;
if (stateOverride === HOSTNAME) return;
failure = url.parseHost(buffer);

@@ -570,3 +595,2 @@ if (failure) return failure;

state = PORT;
if (stateOverride === HOSTNAME) return;
} else if (

@@ -612,2 +636,3 @@ chr === EOF || chr === '/' || chr === '?' || chr === '#' ||

url.scheme = 'file';
url.host = '';
if (chr === '/' || chr === '\\') state = FILE_SLASH;

@@ -635,4 +660,4 @@ else if (base && base.scheme === 'file') {

default:
url.host = base.host;
if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
url.host = base.host;
url.path = arraySlice(base.path);

@@ -654,5 +679,6 @@ url.shortenPath();

}
if (base && base.scheme === 'file' && !startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
if (isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
else url.host = base.host;
if (base && base.scheme === 'file') {
url.host = base.host;
if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))
&& isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
}

@@ -713,3 +739,3 @@ state = PATH;

if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
if (url.host) url.host = '';
if (url.host !== null && url.host !== '') url.host = '';
buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter

@@ -752,5 +778,3 @@ }

} else if (chr !== EOF) {
if (chr === "'" && url.isSpecial()) url.query += '%27';
else if (chr === '#') url.query += '%23';
else url.query += percentEncode(chr, C0ControlPercentEncodeSet);
url.query += percentEncode(chr, url.isSpecial() ? specialQueryPercentEncodeSet : queryPercentEncodeSet);
} break;

@@ -786,5 +810,9 @@

if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
result = parseIPv4(input);
if (result === null) return INVALID_HOST;
this.host = result;
if (endsInNumber(input)) {
result = parseIPv4(input);
if (result === null) return INVALID_HOST;
this.host = result;
} else {
this.host = input;
}
}

@@ -794,3 +822,3 @@ },

cannotHaveUsernamePasswordPort: function () {
return !this.host || this.cannotBeABaseURL || this.scheme === 'file';
return this.host === null || this.host === '' || this.cannotBeABaseURL || this.scheme === 'file';
},

@@ -833,2 +861,3 @@ // https://url.spec.whatwg.org/#include-credentials

} else if (scheme === 'file') output += '//';
if (host === null && !url.cannotBeABaseURL && path.length > 1 && path[0] === '') output += '/.';
output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';

@@ -850,3 +879,3 @@ if (query !== null) output += '?' + query;

if (scheme === 'blob') try {
return new URLConstructor(scheme.path[0]).origin;
return new URLConstructor(this.path[0]).origin;
} catch (error) {

@@ -853,0 +882,0 @@ return 'null';

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

// `URL.parse` method
// https://url.spec.whatwg.org/#dom-url-canparse
// https://url.spec.whatwg.org/#dom-url-parse
$({ target: 'URL', stat: true, forced: !USE_NATIVE_URL }, {

@@ -14,0 +14,0 @@ parse: function parse(url) {

{
"name": "core-js",
"version": "3.48.0",
"version": "3.49.0",
"type": "commonjs",

@@ -21,2 +21,4 @@ "description": "Standard library",

"ES2024",
"ES2025",
"ES2026",
"ECMAScript 3",

@@ -36,2 +38,4 @@ "ECMAScript 5",

"ECMAScript 2024",
"ECMAScript 2025",
"ECMAScript 2026",
"Map",

@@ -38,0 +42,0 @@ "Set",

@@ -12,3 +12,3 @@ ![logo](https://user-images.githubusercontent.com/2213682/146607186-8e13ddef-26a4-4ebf-befd-5aac9d77c090.png)

> Modular standard library for JavaScript. Includes polyfills for [ECMAScript up to 2025](https://github.com/zloirock/core-js#ecmascript): [promises](https://github.com/zloirock/core-js#ecmascript-promise), [symbols](https://github.com/zloirock/core-js#ecmascript-symbol), [collections](https://github.com/zloirock/core-js#ecmascript-collections), iterators, [typed arrays](https://github.com/zloirock/core-js#ecmascript-typed-arrays), many other features, [ECMAScript proposals](https://github.com/zloirock/core-js#ecmascript-proposals), [some cross-platform WHATWG / W3C features and proposals](#web-standards) like [`URL`](https://github.com/zloirock/core-js#url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.
> [`core-js`](https://core-js.io) is a modular standard library for JavaScript. Includes polyfills for ECMAScript up to 2026: [promises](https://core-js.io/docs/features/ecmascript/promise), [symbols](https://core-js.io/docs/features/ecmascript/symbol), [collections](https://core-js.io/docs/features/ecmascript/collections), [iterators](https://core-js.io/docs/features/ecmascript/iterator), [typed arrays](https://core-js.io/docs/features/ecmascript/typed-arrays), many other features, ECMAScript proposals, some cross-platform WHATWG / W3C features and proposals like [`URL`](https://core-js.io/docs/features/web-standards/url-and-urlsearchparams). You can load only required features or use it without global namespace pollution.

@@ -96,2 +96,2 @@ ## Raising funds

**It's a global version (first 2 examples), for more info see [`core-js` documentation](https://github.com/zloirock/core-js/blob/master/README.md).**
**It's a global version (first 2 examples), for more info see [`core-js` documentation](https://core-js.io).**