| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/internals.tar |
string-html-forced.js 0000644 00000000520 15167731775 0010632 0 ustar 00 'use strict';
var fails = require('../internals/fails');
// check the existence of a method, lowercase
// of a tag and escaping quotes in arguments
module.exports = function (METHOD_NAME) {
return fails(function () {
var test = ''[METHOD_NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
});
};
to-integer-or-infinity.js 0000644 00000000536 15167731775 0011453 0 ustar 00 'use strict';
var trunc = require('../internals/math-trunc');
// `ToIntegerOrInfinity` abstract operation
// https://tc39.es/ecma262/#sec-tointegerorinfinity
module.exports = function (argument) {
var number = +argument;
// eslint-disable-next-line no-self-compare -- NaN check
return number !== number || number === 0 ? 0 : trunc(number);
};
string-cooked.js 0000644 00000001777 15167731775 0007711 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toIndexedObject = require('../internals/to-indexed-object');
var toString = require('../internals/to-string');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var $TypeError = TypeError;
var push = uncurryThis([].push);
var join = uncurryThis([].join);
// `String.cooked` method
// https://tc39.es/proposal-string-cooked/
module.exports = function cooked(template /* , ...substitutions */) {
var cookedTemplate = toIndexedObject(template);
var literalSegments = lengthOfArrayLike(cookedTemplate);
if (!literalSegments) return '';
var argumentsLength = arguments.length;
var elements = [];
var i = 0;
while (true) {
var nextVal = cookedTemplate[i++];
if (nextVal === undefined) throw new $TypeError('Incorrect template');
push(elements, toString(nextVal));
if (i === literalSegments) return join(elements, '');
if (i < argumentsLength) push(elements, toString(arguments[i]));
}
};
iterate.js 0000644 00000005002 15167731775 0006557 0 ustar 00 'use strict';
var bind = require('../internals/function-bind-context');
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var tryToString = require('../internals/try-to-string');
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var getIterator = require('../internals/get-iterator');
var getIteratorMethod = require('../internals/get-iterator-method');
var iteratorClose = require('../internals/iterator-close');
var $TypeError = TypeError;
var Result = function (stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
module.exports = function (iterable, unboundFunction, options) {
var that = options && options.that;
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
var IS_RECORD = !!(options && options.IS_RECORD);
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
var INTERRUPTED = !!(options && options.INTERRUPTED);
var fn = bind(unboundFunction, that);
var iterator, iterFn, index, length, result, next, step;
var stop = function (condition) {
if (iterator) iteratorClose(iterator, 'normal', condition);
return new Result(true, condition);
};
var callFn = function (value) {
if (AS_ENTRIES) {
anObject(value);
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
} return INTERRUPTED ? fn(value, stop) : fn(value);
};
if (IS_RECORD) {
iterator = iterable.iterator;
} else if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
// optimisation for array iterators
if (isArrayIteratorMethod(iterFn)) {
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
result = callFn(iterable[index]);
if (result && isPrototypeOf(ResultPrototype, result)) return result;
} return new Result(false);
}
iterator = getIterator(iterable, iterFn);
}
next = IS_RECORD ? iterable.next : iterator.next;
while (!(step = call(next, iterator)).done) {
try {
result = callFn(step.value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
} return new Result(false);
};
array-species-create.js 0000644 00000000507 15167731775 0011137 0 ustar 00 'use strict';
var arraySpeciesConstructor = require('../internals/array-species-constructor');
// `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
module.exports = function (originalArray, length) {
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
};
is-null-or-undefined.js 0000644 00000000337 15167731775 0011070 0 ustar 00 'use strict';
// we can't use just `it == null` since of `document.all` special case
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
module.exports = function (it) {
return it === null || it === undefined;
};
fix-regexp-well-known-symbol-logic.js 0000644 00000000011 15167731775 0013664 0 ustar 00 // empty
shared.js 0000644 00000000240 15167731775 0006367 0 ustar 00 'use strict';
var store = require('../internals/shared-store');
module.exports = function (key, value) {
return store[key] || (store[key] = value || {});
};
not-a-nan.js 0000644 00000000327 15167731775 0006717 0 ustar 00 'use strict';
var $RangeError = RangeError;
module.exports = function (it) {
// eslint-disable-next-line no-self-compare -- NaN check
if (it === it) return it;
throw new $RangeError('NaN is not allowed');
};
function-bind-native.js 0000644 00000000537 15167731775 0011155 0 ustar 00 'use strict';
var fails = require('../internals/fails');
module.exports = !fails(function () {
// eslint-disable-next-line es/no-function-prototype-bind -- safe
var test = (function () { /* empty */ }).bind();
// eslint-disable-next-line no-prototype-builtins -- safe
return typeof test != 'function' || test.hasOwnProperty('prototype');
});
array-to-reversed.js 0000644 00000000643 15167731775 0010503 0 ustar 00 'use strict';
var lengthOfArrayLike = require('../internals/length-of-array-like');
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.toReversed
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.toReversed
module.exports = function (O, C) {
var len = lengthOfArrayLike(O);
var A = new C(len);
var k = 0;
for (; k < len; k++) A[k] = O[len - k - 1];
return A;
};
is-array-iterator-method.js 0000644 00000000567 15167731775 0011771 0 ustar 00 'use strict';
var wellKnownSymbol = require('../internals/well-known-symbol');
var Iterators = require('../internals/iterators');
var ITERATOR = wellKnownSymbol('iterator');
var ArrayPrototype = Array.prototype;
// check on default Array iterator
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
};
array-from.js 0000644 00000004061 15167731775 0007205 0 ustar 00 'use strict';
var bind = require('../internals/function-bind-context');
var call = require('../internals/function-call');
var toObject = require('../internals/to-object');
var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
var isArrayIteratorMethod = require('../internals/is-array-iterator-method');
var isConstructor = require('../internals/is-constructor');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var createProperty = require('../internals/create-property');
var getIterator = require('../internals/get-iterator');
var getIteratorMethod = require('../internals/get-iterator-method');
var $Array = Array;
// `Array.from` method implementation
// https://tc39.es/ecma262/#sec-array.from
module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject(arrayLike);
var IS_CONSTRUCTOR = isConstructor(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
var iteratorMethod = getIteratorMethod(O);
var index = 0;
var length, result, step, iterator, next, value;
// if the target is not iterable or it's an array with the default iterator - use a simple case
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
result = IS_CONSTRUCTOR ? new this() : [];
iterator = getIterator(O, iteratorMethod);
next = iterator.next;
for (;!(step = call(next, iterator)).done; index++) {
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
createProperty(result, index, value);
}
} else {
length = lengthOfArrayLike(O);
result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
for (;length > index; index++) {
value = mapping ? mapfn(O[index], index) : O[index];
createProperty(result, index, value);
}
}
result.length = index;
return result;
};
get-json-replacer-function.js 0000644 00000002000 15167731775 0012261 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var isArray = require('../internals/is-array');
var isCallable = require('../internals/is-callable');
var classof = require('../internals/classof-raw');
var toString = require('../internals/to-string');
var push = uncurryThis([].push);
module.exports = function (replacer) {
if (isCallable(replacer)) return replacer;
if (!isArray(replacer)) return;
var rawLength = replacer.length;
var keys = [];
for (var i = 0; i < rawLength; i++) {
var element = replacer[i];
if (typeof element == 'string') push(keys, element);
else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));
}
var keysLength = keys.length;
var root = true;
return function (key, value) {
if (root) {
root = false;
return value;
}
if (isArray(this)) return value;
for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
};
};
promise-statics-incorrect-iteration.js 0000644 00000000735 15167731775 0014242 0 ustar 00 'use strict';
var NativePromiseConstructor = require('../internals/promise-native-constructor');
var checkCorrectnessOfIteration = require('../internals/check-correctness-of-iteration');
var FORCED_PROMISE_CONSTRUCTOR = require('../internals/promise-constructor-detection').CONSTRUCTOR;
module.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function (iterable) {
NativePromiseConstructor.all(iterable).then(undefined, function () { /* empty */ });
});
object-set-prototype-of.js 0000644 00000002146 15167731775 0011634 0 ustar 00 'use strict';
/* eslint-disable no-proto -- safe */
var uncurryThisAccessor = require('../internals/function-uncurry-this-accessor');
var isObject = require('../internals/is-object');
var requireObjectCoercible = require('../internals/require-object-coercible');
var aPossiblePrototype = require('../internals/a-possible-prototype');
// `Object.setPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
// eslint-disable-next-line es/no-object-setprototypeof -- safe
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
setter(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error) { /* empty */ }
return function setPrototypeOf(O, proto) {
requireObjectCoercible(O);
aPossiblePrototype(proto);
if (!isObject(O)) return O;
if (CORRECT_SETTER) setter(O, proto);
else O.__proto__ = proto;
return O;
};
}() : undefined);
get-iterator-method.js 0000644 00000000774 15167731775 0011021 0 ustar 00 'use strict';
var classof = require('../internals/classof');
var getMethod = require('../internals/get-method');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var Iterators = require('../internals/iterators');
var wellKnownSymbol = require('../internals/well-known-symbol');
var ITERATOR = wellKnownSymbol('iterator');
module.exports = function (it) {
if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
|| getMethod(it, '@@iterator')
|| Iterators[classof(it)];
};
string-repeat.js 0000644 00000001251 15167731775 0007710 0 ustar 00 'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toString = require('../internals/to-string');
var requireObjectCoercible = require('../internals/require-object-coercible');
var $RangeError = RangeError;
// `String.prototype.repeat` method implementation
// https://tc39.es/ecma262/#sec-string.prototype.repeat
module.exports = function repeat(count) {
var str = toString(requireObjectCoercible(this));
var result = '';
var n = toIntegerOrInfinity(count);
if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');
for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
return result;
};
set-species.js 0000644 00000001131 15167731775 0007345 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var wellKnownSymbol = require('../internals/well-known-symbol');
var DESCRIPTORS = require('../internals/descriptors');
var SPECIES = wellKnownSymbol('species');
module.exports = function (CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
defineBuiltInAccessor(Constructor, SPECIES, {
configurable: true,
get: function () { return this; }
});
}
};
composite-key.js 0000644 00000003046 15167731775 0007720 0 ustar 00 'use strict';
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
require('../modules/es.map');
require('../modules/es.weak-map');
var getBuiltIn = require('../internals/get-built-in');
var create = require('../internals/object-create');
var isObject = require('../internals/is-object');
var $Object = Object;
var $TypeError = TypeError;
var Map = getBuiltIn('Map');
var WeakMap = getBuiltIn('WeakMap');
var Node = function () {
// keys
this.object = null;
this.symbol = null;
// child nodes
this.primitives = null;
this.objectsByIndex = create(null);
};
Node.prototype.get = function (key, initializer) {
return this[key] || (this[key] = initializer());
};
Node.prototype.next = function (i, it, IS_OBJECT) {
var store = IS_OBJECT
? this.objectsByIndex[i] || (this.objectsByIndex[i] = new WeakMap())
: this.primitives || (this.primitives = new Map());
var entry = store.get(it);
if (!entry) store.set(it, entry = new Node());
return entry;
};
var root = new Node();
module.exports = function () {
var active = root;
var length = arguments.length;
var i, it;
// for prevent leaking, start from objects
for (i = 0; i < length; i++) {
if (isObject(it = arguments[i])) active = active.next(i, it, true);
}
if (this === $Object && active === root) throw new $TypeError('Composite keys must contain a non-primitive component');
for (i = 0; i < length; i++) {
if (!isObject(it = arguments[i])) active = active.next(i, it, false);
} return active;
};
install-error-cause.js 0000644 00000000660 15167731775 0011022 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
// `InstallErrorCause` abstract operation
// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
module.exports = function (O, options) {
if (isObject(options) && 'cause' in options) {
createNonEnumerableProperty(O, 'cause', options.cause);
}
};
set-difference.js 0000644 00000001573 15167731775 0010016 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var SetHelpers = require('../internals/set-helpers');
var clone = require('../internals/set-clone');
var size = require('../internals/set-size');
var getSetRecord = require('../internals/get-set-record');
var iterateSet = require('../internals/set-iterate');
var iterateSimple = require('../internals/iterate-simple');
var has = SetHelpers.has;
var remove = SetHelpers.remove;
// `Set.prototype.difference` method
// https://github.com/tc39/proposal-set-methods
module.exports = function difference(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
var result = clone(O);
if (size(O) <= otherRec.size) iterateSet(O, function (e) {
if (otherRec.includes(e)) remove(result, e);
});
else iterateSimple(otherRec.getIterator(), function (e) {
if (has(O, e)) remove(result, e);
});
return result;
};
weak-map-basic-detection.js 0000644 00000000336 15167731775 0011664 0 ustar 00 'use strict';
var global = require('../internals/global');
var isCallable = require('../internals/is-callable');
var WeakMap = global.WeakMap;
module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
dom-exception-constants.js 0000644 00000003022 15167731775 0011707 0 ustar 00 'use strict';
module.exports = {
IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 },
DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 },
HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 },
WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 },
InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 },
NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 },
NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 },
NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 },
NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 },
InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 },
InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 },
SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 },
InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 },
NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 },
InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 },
ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 },
TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 },
SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 },
NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 },
AbortError: { s: 'ABORT_ERR', c: 20, m: 1 },
URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 },
QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 },
TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 },
InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 },
DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 }
};
global.js 0000644 00000001211 15167731775 0006360 0 ustar 00 'use strict';
var check = function (it) {
return it && it.Math === Math && it;
};
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
module.exports =
// eslint-disable-next-line es/no-global-this -- safe
check(typeof globalThis == 'object' && globalThis) ||
check(typeof window == 'object' && window) ||
// eslint-disable-next-line no-restricted-globals -- safe
check(typeof self == 'object' && self) ||
check(typeof global == 'object' && global) ||
check(typeof this == 'object' && this) ||
// eslint-disable-next-line no-new-func -- fallback
(function () { return this; })() || Function('return this')();
async-iterator-create-proxy.js 0000644 00000010365 15167731775 0012516 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var perform = require('../internals/perform');
var anObject = require('../internals/an-object');
var create = require('../internals/object-create');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var defineBuiltIns = require('../internals/define-built-ins');
var wellKnownSymbol = require('../internals/well-known-symbol');
var InternalStateModule = require('../internals/internal-state');
var getBuiltIn = require('../internals/get-built-in');
var getMethod = require('../internals/get-method');
var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
var createIterResultObject = require('../internals/create-iter-result-object');
var iteratorClose = require('../internals/iterator-close');
var Promise = getBuiltIn('Promise');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var ASYNC_ITERATOR_HELPER = 'AsyncIteratorHelper';
var WRAP_FOR_VALID_ASYNC_ITERATOR = 'WrapForValidAsyncIterator';
var setInternalState = InternalStateModule.set;
var createAsyncIteratorProxyPrototype = function (IS_ITERATOR) {
var IS_GENERATOR = !IS_ITERATOR;
var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER);
var getStateOrEarlyExit = function (that) {
var stateCompletion = perform(function () {
return getInternalState(that);
});
var stateError = stateCompletion.error;
var state = stateCompletion.value;
if (stateError || (IS_GENERATOR && state.done)) {
return { exit: true, value: stateError ? Promise.reject(state) : Promise.resolve(createIterResultObject(undefined, true)) };
} return { exit: false, value: state };
};
return defineBuiltIns(create(AsyncIteratorPrototype), {
next: function next() {
var stateCompletion = getStateOrEarlyExit(this);
var state = stateCompletion.value;
if (stateCompletion.exit) return state;
var handlerCompletion = perform(function () {
return anObject(state.nextHandler(Promise));
});
var handlerError = handlerCompletion.error;
var value = handlerCompletion.value;
if (handlerError) state.done = true;
return handlerError ? Promise.reject(value) : Promise.resolve(value);
},
'return': function () {
var stateCompletion = getStateOrEarlyExit(this);
var state = stateCompletion.value;
if (stateCompletion.exit) return state;
state.done = true;
var iterator = state.iterator;
var returnMethod, result;
var completion = perform(function () {
if (state.inner) try {
iteratorClose(state.inner.iterator, 'normal');
} catch (error) {
return iteratorClose(iterator, 'throw', error);
}
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 WrapForValidAsyncIteratorPrototype = createAsyncIteratorProxyPrototype(true);
var AsyncIteratorHelperPrototype = createAsyncIteratorProxyPrototype(false);
createNonEnumerableProperty(AsyncIteratorHelperPrototype, TO_STRING_TAG, 'Async Iterator Helper');
module.exports = function (nextHandler, IS_ITERATOR) {
var AsyncIteratorProxy = function AsyncIterator(record, state) {
if (state) {
state.iterator = record.iterator;
state.next = record.next;
} else state = record;
state.type = IS_ITERATOR ? WRAP_FOR_VALID_ASYNC_ITERATOR : ASYNC_ITERATOR_HELPER;
state.nextHandler = nextHandler;
state.counter = 0;
state.done = false;
setInternalState(this, state);
};
AsyncIteratorProxy.prototype = IS_ITERATOR ? WrapForValidAsyncIteratorPrototype : AsyncIteratorHelperPrototype;
return AsyncIteratorProxy;
};
engine-v8-version.js 0000644 00000001540 15167731775 0010410 0 ustar 00 'use strict';
var global = require('../internals/global');
var userAgent = require('../internals/engine-user-agent');
var process = global.process;
var Deno = global.Deno;
var versions = process && process.versions || Deno && Deno.version;
var v8 = versions && versions.v8;
var match, version;
if (v8) {
match = v8.split('.');
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
// but their correct versions are not interesting for us
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
}
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
// so check `userAgent` even if `.v8` exists, but 0
if (!version && userAgent) {
match = userAgent.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = userAgent.match(/Chrome\/(\d+)/);
if (match) version = +match[1];
}
}
module.exports = version;
string-trim-start.js 0000644 00000001002 15167731775 0010530 0 ustar 00 'use strict';
var $trimStart = require('../internals/string-trim').start;
var forcedStringTrimMethod = require('../internals/string-trim-forced');
// `String.prototype.{ trimStart, trimLeft }` method
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
// https://tc39.es/ecma262/#String.prototype.trimleft
module.exports = forcedStringTrimMethod('trimStart') ? function trimStart() {
return $trimStart(this);
// eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
} : ''.trimStart;
numeric-range-iterator.js 0000644 00000006736 15167731775 0011524 0 ustar 00 'use strict';
var InternalStateModule = require('../internals/internal-state');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var isObject = require('../internals/is-object');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var DESCRIPTORS = require('../internals/descriptors');
var INCORRECT_RANGE = 'Incorrect Iterator.range arguments';
var NUMERIC_RANGE_ITERATOR = 'NumericRangeIterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(NUMERIC_RANGE_ITERATOR);
var $RangeError = RangeError;
var $TypeError = TypeError;
var $RangeIterator = createIteratorConstructor(function NumericRangeIterator(start, end, option, type, zero, one) {
// TODO: Drop the first `typeof` check after removing legacy methods in `core-js@4`
if (typeof start != type || (end !== Infinity && end !== -Infinity && typeof end != type)) {
throw new $TypeError(INCORRECT_RANGE);
}
if (start === Infinity || start === -Infinity) {
throw new $RangeError(INCORRECT_RANGE);
}
var ifIncrease = end > start;
var inclusiveEnd = false;
var step;
if (option === undefined) {
step = undefined;
} else if (isObject(option)) {
step = option.step;
inclusiveEnd = !!option.inclusive;
} else if (typeof option == type) {
step = option;
} else {
throw new $TypeError(INCORRECT_RANGE);
}
if (isNullOrUndefined(step)) {
step = ifIncrease ? one : -one;
}
if (typeof step != type) {
throw new $TypeError(INCORRECT_RANGE);
}
if (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);
setInternalState(this, {
type: NUMERIC_RANGE_ITERATOR,
start: start,
end: end,
step: step,
inclusive: inclusiveEnd,
hitsEnd: hitsEnd,
currentCount: zero,
zero: zero
});
if (!DESCRIPTORS) {
this.start = start;
this.end = end;
this.step = step;
this.inclusive = inclusiveEnd;
}
}, NUMERIC_RANGE_ITERATOR, function next() {
var state = getInternalState(this);
if (state.hitsEnd) return createIterResultObject(undefined, true);
var start = state.start;
var end = state.end;
var step = state.step;
var currentYieldingValue = start + (step * state.currentCount++);
if (currentYieldingValue === end) state.hitsEnd = true;
var inclusiveEnd = state.inclusive;
var endCondition;
if (end > start) {
endCondition = inclusiveEnd ? currentYieldingValue > end : currentYieldingValue >= end;
} else {
endCondition = inclusiveEnd ? end > currentYieldingValue : end >= currentYieldingValue;
}
if (endCondition) {
state.hitsEnd = true;
return createIterResultObject(undefined, true);
} return createIterResultObject(currentYieldingValue, false);
});
var addGetter = function (key) {
defineBuiltInAccessor($RangeIterator.prototype, key, {
get: function () {
return getInternalState(this)[key];
},
set: function () { /* empty */ },
configurable: true,
enumerable: false
});
};
if (DESCRIPTORS) {
addGetter('start');
addGetter('end');
addGetter('inclusive');
addGetter('step');
}
module.exports = $RangeIterator;
map-helpers.js 0000644 00000000464 15167731775 0007346 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var caller = require('../internals/caller');
var Map = getBuiltIn('Map');
module.exports = {
Map: Map,
set: caller('set', 2),
get: caller('get', 1),
has: caller('has', 1),
remove: caller('delete', 1),
proto: Map.prototype
};
get-async-iterator.js 0000644 00000001341 15167731775 0010645 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var AsyncFromSyncIterator = require('../internals/async-from-sync-iterator');
var anObject = require('../internals/an-object');
var getIterator = require('../internals/get-iterator');
var getIteratorDirect = require('../internals/get-iterator-direct');
var getMethod = require('../internals/get-method');
var wellKnownSymbol = require('../internals/well-known-symbol');
var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
module.exports = function (it, usingIterator) {
var method = arguments.length < 2 ? getMethod(it, ASYNC_ITERATOR) : usingIterator;
return method ? anObject(call(method, it)) : new AsyncFromSyncIterator(getIteratorDirect(getIterator(it)));
};
iterator-map.js 0000644 00000001661 15167731775 0007535 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var aCallable = require('../internals/a-callable');
var anObject = require('../internals/an-object');
var getIteratorDirect = require('../internals/get-iterator-direct');
var createIteratorProxy = require('../internals/iterator-create-proxy');
var callWithSafeIterationClosing = require('../internals/call-with-safe-iteration-closing');
var IteratorProxy = createIteratorProxy(function () {
var iterator = this.iterator;
var result = anObject(call(this.next, iterator));
var done = this.done = !!result.done;
if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
});
// `Iterator.prototype.map` method
// https://github.com/tc39/proposal-iterator-helpers
module.exports = function map(mapper) {
anObject(this);
aCallable(mapper);
return new IteratorProxy(getIteratorDirect(this), {
mapper: mapper
});
};
function-uncurry-this-accessor.js 0000644 00000000612 15167731775 0013223 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
module.exports = function (object, key, method) {
try {
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
} catch (error) { /* empty */ }
};
queue.js 0000644 00000000764 15167731775 0006260 0 ustar 00 'use strict';
var Queue = function () {
this.head = null;
this.tail = null;
};
Queue.prototype = {
add: function (item) {
var entry = { item: item, next: null };
var tail = this.tail;
if (tail) tail.next = entry;
else this.head = entry;
this.tail = entry;
},
get: function () {
var entry = this.head;
if (entry) {
var next = this.head = entry.next;
if (next === null) this.tail = null;
return entry.item;
}
}
};
module.exports = Queue;
engine-is-node.js 0000644 00000000247 15167731775 0007731 0 ustar 00 'use strict';
var global = require('../internals/global');
var classof = require('../internals/classof-raw');
module.exports = classof(global.process) === 'process';
to-primitive.js 0000644 00000001773 15167731775 0007565 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var isObject = require('../internals/is-object');
var isSymbol = require('../internals/is-symbol');
var getMethod = require('../internals/get-method');
var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
var wellKnownSymbol = require('../internals/well-known-symbol');
var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
// `ToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-toprimitive
module.exports = function (input, pref) {
if (!isObject(input) || isSymbol(input)) return input;
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === undefined) pref = 'default';
result = call(exoticToPrim, input, pref);
if (!isObject(result) || isSymbol(result)) return result;
throw new $TypeError("Can't convert object to primitive value");
}
if (pref === undefined) pref = 'number';
return ordinaryToPrimitive(input, pref);
};
native-raw-json.js 0000644 00000000433 15167731775 0010151 0 ustar 00 'use strict';
/* eslint-disable es/no-json -- safe */
var fails = require('../internals/fails');
module.exports = !fails(function () {
var unsafeInt = '9007199254740993';
var raw = JSON.rawJSON(unsafeInt);
return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt;
});
function-bind-context.js 0000644 00000000736 15167731775 0011354 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this-clause');
var aCallable = require('../internals/a-callable');
var NATIVE_BIND = require('../internals/function-bind-native');
var bind = uncurryThis(uncurryThis.bind);
// optional / simple context binding
module.exports = function (fn, that) {
aCallable(fn);
return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
return fn.apply(that, arguments);
};
};
copy-constructor-properties.js 0000644 00000001317 15167731775 0012656 0 ustar 00 'use strict';
var hasOwn = require('../internals/has-own-property');
var ownKeys = require('../internals/own-keys');
var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor');
var definePropertyModule = require('../internals/object-define-property');
module.exports = function (target, source, exceptions) {
var keys = ownKeys(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
to-indexed-object.js 0000644 00000000453 15167731775 0010433 0 ustar 00 'use strict';
// toObject with fallback for non-array-like ES3 strings
var IndexedObject = require('../internals/indexed-object');
var requireObjectCoercible = require('../internals/require-object-coercible');
module.exports = function (it) {
return IndexedObject(requireObjectCoercible(it));
};
is-forced.js 0000644 00000001172 15167731775 0007001 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var isCallable = require('../internals/is-callable');
var replacement = /#|\.prototype\./;
var isForced = function (feature, detection) {
var value = data[normalize(feature)];
return value === POLYFILL ? true
: value === NATIVE ? false
: isCallable(detection) ? fails(detection)
: !!detection;
};
var normalize = isForced.normalize = function (string) {
return String(string).replace(replacement, '.').toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = 'N';
var POLYFILL = isForced.POLYFILL = 'P';
module.exports = isForced;
array-method-has-species-support.js 0000644 00000001257 15167731775 0013442 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var wellKnownSymbol = require('../internals/well-known-symbol');
var V8_VERSION = require('../internals/engine-v8-version');
var SPECIES = wellKnownSymbol('species');
module.exports = function (METHOD_NAME) {
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/677
return V8_VERSION >= 51 || !fails(function () {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
to-index.js 0000644 00000000733 15167731775 0006657 0 ustar 00 'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toLength = require('../internals/to-length');
var $RangeError = RangeError;
// `ToIndex` abstract operation
// https://tc39.es/ecma262/#sec-toindex
module.exports = function (it) {
if (it === undefined) return 0;
var number = toIntegerOrInfinity(it);
var length = toLength(number);
if (number !== length) throw new $RangeError('Wrong length or index');
return length;
};
promise-constructor-detection.js 0000644 00000005062 15167731775 0013145 0 ustar 00 'use strict';
var global = require('../internals/global');
var NativePromiseConstructor = require('../internals/promise-native-constructor');
var isCallable = require('../internals/is-callable');
var isForced = require('../internals/is-forced');
var inspectSource = require('../internals/inspect-source');
var wellKnownSymbol = require('../internals/well-known-symbol');
var IS_BROWSER = require('../internals/engine-is-browser');
var IS_DENO = require('../internals/engine-is-deno');
var IS_PURE = require('../internals/is-pure');
var V8_VERSION = require('../internals/engine-v8-version');
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var SPECIES = wellKnownSymbol('species');
var SUBCLASSING = false;
var NATIVE_PROMISE_REJECTION_EVENT = isCallable(global.PromiseRejectionEvent);
var FORCED_PROMISE_CONSTRUCTOR = isForced('Promise', function () {
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
// V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
// https://bugs.chromium.org/p/chromium/issues/detail?id=830565
// We can't detect it synchronously, so just check versions
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
// We need Promise#{ catch, finally } in the pure version for preventing prototype pollution
if (IS_PURE && !(NativePromisePrototype['catch'] && NativePromisePrototype['finally'])) return true;
// We can't use @@species feature detection in V8 since it causes
// deoptimization and performance degradation
// https://github.com/zloirock/core-js/issues/679
if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
// Detect correctness of subclassing with @@species support
var promise = new NativePromiseConstructor(function (resolve) { resolve(1); });
var FakePromise = function (exec) {
exec(function () { /* empty */ }, function () { /* empty */ });
};
var constructor = promise.constructor = {};
constructor[SPECIES] = FakePromise;
SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
if (!SUBCLASSING) return true;
// Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
} return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT;
});
module.exports = {
CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
SUBCLASSING: SUBCLASSING
};
object-get-own-property-symbols.js 0000644 00000000177 15167731775 0013326 0 ustar 00 'use strict';
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
exports.f = Object.getOwnPropertySymbols;
a-string.js 0000644 00000000275 15167731775 0006655 0 ustar 00 'use strict';
var $TypeError = TypeError;
module.exports = function (argument) {
if (typeof argument == 'string') return argument;
throw new $TypeError('Argument is not a string');
};
check-correctness-of-iteration.js 0000644 00000002067 15167731775 0013135 0 ustar 00 'use strict';
var wellKnownSymbol = require('../internals/well-known-symbol');
var ITERATOR = wellKnownSymbol('iterator');
var SAFE_CLOSING = false;
try {
var called = 0;
var iteratorWithReturn = {
next: function () {
return { done: !!called++ };
},
'return': function () {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR] = function () {
return this;
};
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
Array.from(iteratorWithReturn, function () { throw 2; });
} catch (error) { /* empty */ }
module.exports = function (exec, SKIP_CLOSING) {
try {
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
} catch (error) { return false; } // workaround of old WebKit + `eval` bug
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR] = function () {
return {
next: function () {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec(object);
} catch (error) { /* empty */ }
return ITERATION_SUPPORT;
};
to-uint8-clamped.js 0000644 00000000241 15167731775 0010214 0 ustar 00 'use strict';
var round = Math.round;
module.exports = function (it) {
var value = round(it);
return value < 0 ? 0 : value > 0xFF ? 0xFF : value & 0xFF;
};
does-not-exceed-safe-integer.js 0000644 00000000371 15167731775 0012460 0 ustar 00 'use strict';
var $TypeError = TypeError;
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
module.exports = function (it) {
if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
return it;
};
engine-is-ios-pebble.js 0000644 00000000240 15167731775 0011016 0 ustar 00 'use strict';
var userAgent = require('../internals/engine-user-agent');
module.exports = /ipad|iphone|ipod/i.test(userAgent) && typeof Pebble != 'undefined';
classof-raw.js 0000644 00000000362 15167731775 0007347 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis(''.slice);
module.exports = function (it) {
return stringSlice(toString(it), 8, -1);
};
correct-prototype-getter.js 0000644 00000000460 15167731775 0012121 0 ustar 00 'use strict';
var fails = require('../internals/fails');
module.exports = !fails(function () {
function F() { /* empty */ }
F.prototype.constructor = null;
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
return Object.getPrototypeOf(new F()) !== F.prototype;
});
an-uint8-array.js 0000644 00000000613 15167731775 0007704 0 ustar 00 'use strict';
var classof = require('../internals/classof');
var $TypeError = TypeError;
// Perform ? RequireInternalSlot(argument, [[TypedArrayName]])
// If argument.[[TypedArrayName]] is not "Uint8Array", throw a TypeError exception
module.exports = function (argument) {
if (classof(argument) === 'Uint8Array') return argument;
throw new $TypeError('Argument is not an Uint8Array');
};
array-method-is-strict.js 0000644 00000000511 15167731775 0011435 0 ustar 00 'use strict';
var fails = require('../internals/fails');
module.exports = function (METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails(function () {
// eslint-disable-next-line no-useless-call -- required for testing
method.call(null, argument || function () { return 1; }, 1);
});
};
enum-bug-keys.js 0000644 00000000300 15167731775 0007606 0 ustar 00 'use strict';
// IE8- don't enum bug keys
module.exports = [
'constructor',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toLocaleString',
'toString',
'valueOf'
];
object-create.js 0000644 00000006015 15167731775 0007636 0 ustar 00 'use strict';
/* global ActiveXObject -- old IE, WSH */
var anObject = require('../internals/an-object');
var definePropertiesModule = require('../internals/object-define-properties');
var enumBugKeys = require('../internals/enum-bug-keys');
var hiddenKeys = require('../internals/hidden-keys');
var html = require('../internals/html');
var documentCreateElement = require('../internals/document-create-element');
var sharedKey = require('../internals/shared-key');
var GT = '>';
var LT = '<';
var PROTOTYPE = 'prototype';
var SCRIPT = 'script';
var IE_PROTO = sharedKey('IE_PROTO');
var EmptyConstructor = function () { /* empty */ };
var scriptTag = function (content) {
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
};
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
var NullProtoObjectViaActiveX = function (activeXDocument) {
activeXDocument.write(scriptTag(''));
activeXDocument.close();
var temp = activeXDocument.parentWindow.Object;
activeXDocument = null; // avoid memory leak
return temp;
};
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var NullProtoObjectViaIFrame = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = documentCreateElement('iframe');
var JS = 'java' + SCRIPT + ':';
var iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
// https://github.com/zloirock/core-js/issues/475
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag('document.F=Object'));
iframeDocument.close();
return iframeDocument.F;
};
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
// avoid IE GC bug
var activeXDocument;
var NullProtoObject = function () {
try {
activeXDocument = new ActiveXObject('htmlfile');
} catch (error) { /* ignore */ }
NullProtoObject = typeof document != 'undefined'
? document.domain && activeXDocument
? NullProtoObjectViaActiveX(activeXDocument) // old IE
: NullProtoObjectViaIFrame()
: NullProtoObjectViaActiveX(activeXDocument); // WSH
var length = enumBugKeys.length;
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
// `Object.create` method
// https://tc39.es/ecma262/#sec-object.create
// eslint-disable-next-line es/no-object-create -- safe
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = NullProtoObject();
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
};
set-method-accept-set-like.js 0000644 00000000100 15167731775 0012135 0 ustar 00 'use strict';
module.exports = function () {
return false;
};
export.js 0000644 00000011127 15167731775 0006450 0 ustar 00 'use strict';
var global = require('../internals/global');
var apply = require('../internals/function-apply');
var uncurryThis = require('../internals/function-uncurry-this-clause');
var isCallable = require('../internals/is-callable');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var isForced = require('../internals/is-forced');
var path = require('../internals/path');
var bind = require('../internals/function-bind-context');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var hasOwn = require('../internals/has-own-property');
// add debugging info
require('../internals/shared-store');
var wrapConstructor = function (NativeConstructor) {
var Wrapper = function (a, b, c) {
if (this instanceof Wrapper) {
switch (arguments.length) {
case 0: return new NativeConstructor();
case 1: return new NativeConstructor(a);
case 2: return new NativeConstructor(a, b);
} return new NativeConstructor(a, b, c);
} return apply(NativeConstructor, this, arguments);
};
Wrapper.prototype = NativeConstructor.prototype;
return Wrapper;
};
/*
options.target - name of the target object
options.global - target is the global object
options.stat - export as static methods of target
options.proto - export as prototype methods of target
options.real - real prototype method for the `pure` version
options.forced - export even if the native feature is available
options.bind - bind methods to the target, required for the `pure` version
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
options.unsafe - use the simple assignment of property instead of delete + defineProperty
options.sham - add a flag to not completely full polyfills
options.enumerable - export as enumerable property
options.dontCallGetSet - prevent calling a getter on target
options.name - the .name of the function if it does not match the key
*/
module.exports = function (options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var PROTO = options.proto;
var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : global[TARGET] && global[TARGET].prototype;
var target = GLOBAL ? path : path[TARGET] || createNonEnumerableProperty(path, TARGET, {})[TARGET];
var targetPrototype = target.prototype;
var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
for (key in source) {
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
// contains in native
USE_NATIVE = !FORCED && nativeSource && hasOwn(nativeSource, key);
targetProperty = target[key];
if (USE_NATIVE) if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor(nativeSource, key);
nativeProperty = descriptor && descriptor.value;
} else nativeProperty = nativeSource[key];
// export native or implementation
sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
if (!FORCED && !PROTO && typeof targetProperty == typeof sourceProperty) continue;
// bind methods to global for calling from export context
if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global);
// wrap global constructors for prevent changes in this version
else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
// make static versions for prototype methods
else if (PROTO && isCallable(sourceProperty)) resultProperty = uncurryThis(sourceProperty);
// default case
else resultProperty = sourceProperty;
// add a flag to not completely full polyfills
if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
createNonEnumerableProperty(resultProperty, 'sham', true);
}
createNonEnumerableProperty(target, key, resultProperty);
if (PROTO) {
VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
if (!hasOwn(path, VIRTUAL_PROTOTYPE)) {
createNonEnumerableProperty(path, VIRTUAL_PROTOTYPE, {});
}
// export virtual prototype methods
createNonEnumerableProperty(path[VIRTUAL_PROTOTYPE], key, sourceProperty);
// export real prototype methods
if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {
createNonEnumerableProperty(targetPrototype, key, sourceProperty);
}
}
}
};
entry-unbind.js 0000644 00000000143 15167731775 0007541 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
module.exports = getBuiltIn;
this-number-value.js 0000644 00000000323 15167731775 0010472 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
// `thisNumberValue` abstract operation
// https://tc39.es/ecma262/#sec-thisnumbervalue
module.exports = uncurryThis(1.0.valueOf);
math-float-round.js 0000644 00000001421 15167731775 0010304 0 ustar 00 'use strict';
var sign = require('../internals/math-sign');
var abs = Math.abs;
var EPSILON = 2.220446049250313e-16; // Number.EPSILON
var INVERSE_EPSILON = 1 / EPSILON;
var roundTiesToEven = function (n) {
return n + INVERSE_EPSILON - INVERSE_EPSILON;
};
module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
var n = +x;
var absolute = abs(n);
var s = sign(n);
if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
var a = (1 + FLOAT_EPSILON / EPSILON) * absolute;
var result = a - (a - absolute);
// eslint-disable-next-line no-self-compare -- NaN check
if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity;
return s * result;
};
object-is-extensible.js 0000644 00000001425 15167731775 0011146 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var isObject = require('../internals/is-object');
var classof = require('../internals/classof-raw');
var ARRAY_BUFFER_NON_EXTENSIBLE = require('../internals/array-buffer-non-extensible');
// eslint-disable-next-line es/no-object-isextensible -- safe
var $isExtensible = Object.isExtensible;
var FAILS_ON_PRIMITIVES = fails(function () { $isExtensible(1); });
// `Object.isExtensible` method
// https://tc39.es/ecma262/#sec-object.isextensible
module.exports = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
if (!isObject(it)) return false;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false;
return $isExtensible ? $isExtensible(it) : true;
} : $isExtensible;
map-upsert.js 0000644 00000001743 15167731775 0007227 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var aCallable = require('../internals/a-callable');
var isCallable = require('../internals/is-callable');
var anObject = require('../internals/an-object');
var $TypeError = TypeError;
// `Map.prototype.upsert` method
// https://github.com/tc39/proposal-upsert
module.exports = function upsert(key, updateFn /* , insertFn */) {
var map = anObject(this);
var get = aCallable(map.get);
var has = aCallable(map.has);
var set = aCallable(map.set);
var insertFn = arguments.length > 2 ? arguments[2] : undefined;
var value;
if (!isCallable(updateFn) && !isCallable(insertFn)) {
throw new $TypeError('At least one callback required');
}
if (call(has, map, key)) {
value = call(get, map, key);
if (isCallable(updateFn)) {
value = updateFn(value);
call(set, map, key, value);
}
} else if (isCallable(insertFn)) {
value = insertFn();
call(set, map, key, value);
} return value;
};
to-offset.js 0000644 00000000011 15167731775 0007023 0 ustar 00 // empty
use-symbol-as-uid.js 0000644 00000000355 15167731775 0010407 0 ustar 00 'use strict';
/* eslint-disable es/no-symbol -- required for testing */
var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
module.exports = NATIVE_SYMBOL
&& !Symbol.sham
&& typeof Symbol.iterator == 'symbol';
error-stack-install.js 0000644 00000001064 15167731775 0011026 0 ustar 00 'use strict';
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var clearErrorStack = require('../internals/error-stack-clear');
var ERROR_STACK_INSTALLABLE = require('../internals/error-stack-installable');
// non-standard V8
var captureStackTrace = Error.captureStackTrace;
module.exports = function (error, C, stack, dropEntries) {
if (ERROR_STACK_INSTALLABLE) {
if (captureStackTrace) captureStackTrace(error, C);
else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));
}
};
iterator-define.js 0000644 00000010643 15167731775 0010212 0 ustar 00 'use strict';
var $ = require('../internals/export');
var call = require('../internals/function-call');
var IS_PURE = require('../internals/is-pure');
var FunctionName = require('../internals/function-name');
var isCallable = require('../internals/is-callable');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var setPrototypeOf = require('../internals/object-set-prototype-of');
var setToStringTag = require('../internals/set-to-string-tag');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var defineBuiltIn = require('../internals/define-built-in');
var wellKnownSymbol = require('../internals/well-known-symbol');
var Iterators = require('../internals/iterators');
var IteratorsCore = require('../internals/iterators-core');
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR = wellKnownSymbol('iterator');
var KEYS = 'keys';
var VALUES = 'values';
var ENTRIES = 'entries';
var returnThis = function () { return this; };
module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor(IteratorConstructor, NAME, next);
var getIterationMethod = function (KIND) {
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
switch (KIND) {
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
}
return function () { return new IteratorConstructor(this); };
};
var TO_STRING_TAG = NAME + ' Iterator';
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR]
|| IterablePrototype['@@iterator']
|| DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;
// fix native
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
}
}
// Set @@toStringTag to native iterators
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
}
}
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() { return call(nativeIterator, this); };
}
}
// export additional methods
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED) for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
}
} else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
}
// define iterator
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
}
Iterators[NAME] = defaultIterator;
return methods;
};
is-possible-prototype.js 0000644 00000000235 15167731775 0011421 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
module.exports = function (argument) {
return isObject(argument) || argument === null;
};
set-is-subset-of.js 0000644 00000001102 15167731775 0010230 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var size = require('../internals/set-size');
var iterate = require('../internals/set-iterate');
var getSetRecord = require('../internals/get-set-record');
// `Set.prototype.isSubsetOf` method
// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
module.exports = function isSubsetOf(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
if (size(O) > otherRec.size) return false;
return iterate(O, function (e) {
if (!otherRec.includes(e)) return false;
}, true) !== false;
};
descriptors.js 0000644 00000000503 15167731775 0007464 0 ustar 00 'use strict';
var fails = require('../internals/fails');
// Detect IE8's incomplete defineProperty implementation
module.exports = !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
});
date-to-iso-string.js 0000644 00000003441 15167731775 0010560 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var fails = require('../internals/fails');
var padStart = require('../internals/string-pad').start;
var $RangeError = RangeError;
var $isFinite = isFinite;
var abs = Math.abs;
var DatePrototype = Date.prototype;
var nativeDateToISOString = DatePrototype.toISOString;
var thisTimeValue = uncurryThis(DatePrototype.getTime);
var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds);
var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes);
var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth);
var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
// `Date.prototype.toISOString` method implementation
// https://tc39.es/ecma262/#sec-date.prototype.toisostring
// PhantomJS / old WebKit fails here:
module.exports = (fails(function () {
return nativeDateToISOString.call(new Date(-5e13 - 1)) !== '0385-07-25T07:06:39.999Z';
}) || !fails(function () {
nativeDateToISOString.call(new Date(NaN));
})) ? function toISOString() {
if (!$isFinite(thisTimeValue(this))) throw new $RangeError('Invalid time value');
var date = this;
var year = getUTCFullYear(date);
var milliseconds = getUTCMilliseconds(date);
var sign = year < 0 ? '-' : year > 9999 ? '+' : '';
return sign + padStart(abs(year), sign ? 6 : 4, 0) +
'-' + padStart(getUTCMonth(date) + 1, 2, 0) +
'-' + padStart(getUTCDate(date), 2, 0) +
'T' + padStart(getUTCHours(date), 2, 0) +
':' + padStart(getUTCMinutes(date), 2, 0) +
':' + padStart(getUTCSeconds(date), 2, 0) +
'.' + padStart(milliseconds, 3, 0) +
'Z';
} : nativeDateToISOString;
object-keys.js 0000644 00000000554 15167731775 0007350 0 ustar 00 'use strict';
var internalObjectKeys = require('../internals/object-keys-internal');
var enumBugKeys = require('../internals/enum-bug-keys');
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
// eslint-disable-next-line es/no-object-keys -- safe
module.exports = Object.keys || function keys(O) {
return internalObjectKeys(O, enumBugKeys);
};
typed-array-constructor.js 0000644 00000000011 15167731775 0011741 0 ustar 00 // empty
a-possible-prototype.js 0000644 00000000471 15167731775 0011230 0 ustar 00 'use strict';
var isPossiblePrototype = require('../internals/is-possible-prototype');
var $String = String;
var $TypeError = TypeError;
module.exports = function (argument) {
if (isPossiblePrototype(argument)) return argument;
throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
};
number-parse-float.js 0000644 00000001700 15167731775 0010626 0 ustar 00 'use strict';
var global = require('../internals/global');
var fails = require('../internals/fails');
var uncurryThis = require('../internals/function-uncurry-this');
var toString = require('../internals/to-string');
var trim = require('../internals/string-trim').trim;
var whitespaces = require('../internals/whitespaces');
var charAt = uncurryThis(''.charAt);
var $parseFloat = global.parseFloat;
var Symbol = global.Symbol;
var ITERATOR = Symbol && Symbol.iterator;
var FORCED = 1 / $parseFloat(whitespaces + '-0') !== -Infinity
// MS Edge 18- broken with boxed symbols
|| (ITERATOR && !fails(function () { $parseFloat(Object(ITERATOR)); }));
// `parseFloat` method
// https://tc39.es/ecma262/#sec-parsefloat-string
module.exports = FORCED ? function parseFloat(string) {
var trimmedString = trim(toString(string));
var result = $parseFloat(trimmedString);
return result === 0 && charAt(trimmedString, 0) === '-' ? -0 : result;
} : $parseFloat;
base64-map.js 0000644 00000001053 15167731775 0006763 0 ustar 00 'use strict';
var commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var base64Alphabet = commonAlphabet + '+/';
var base64UrlAlphabet = commonAlphabet + '-_';
var inverse = function (characters) {
// TODO: use `Object.create(null)` in `core-js@4`
var result = {};
var index = 0;
for (; index < 64; index++) result[characters.charAt(index)] = index;
return result;
};
module.exports = {
i2c: base64Alphabet,
c2i: inverse(base64Alphabet),
i2cUrl: base64UrlAlphabet,
c2iUrl: inverse(base64UrlAlphabet)
};
is-big-int-array.js 0000644 00000000277 15167731775 0010211 0 ustar 00 'use strict';
var classof = require('../internals/classof');
module.exports = function (it) {
var klass = classof(it);
return klass === 'BigInt64Array' || klass === 'BigUint64Array';
};
math-fround.js 0000644 00000001032 15167731775 0007345 0 ustar 00 'use strict';
var floatRound = require('../internals/math-float-round');
var FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23;
var FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104
var FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126;
// `Math.fround` method implementation
// https://tc39.es/ecma262/#sec-math.fround
// eslint-disable-next-line es/no-math-fround -- safe
module.exports = Math.fround || function fround(x) {
return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);
};
get-substitution.js 0000644 00000003145 15167731775 0010461 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toObject = require('../internals/to-object');
var floor = Math.floor;
var charAt = uncurryThis(''.charAt);
var replace = uncurryThis(''.replace);
var stringSlice = uncurryThis(''.slice);
// eslint-disable-next-line redos/no-vulnerable -- safe
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
// `GetSubstitution` abstract operation
// https://tc39.es/ecma262/#sec-getsubstitution
module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace(replacement, symbols, function (match, ch) {
var capture;
switch (charAt(ch, 0)) {
case '$': return '$';
case '&': return matched;
case '`': return stringSlice(str, 0, position);
case "'": return stringSlice(str, tailPos);
case '<':
capture = namedCaptures[stringSlice(ch, 1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
};
regexp-get-flags.js 0000644 00000000765 15167731775 0010276 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var hasOwn = require('../internals/has-own-property');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var regExpFlags = require('../internals/regexp-flags');
var RegExpPrototype = RegExp.prototype;
module.exports = function (R) {
var flags = R.flags;
return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R)
? call(regExpFlags, R) : flags;
};
array-set-length.js 0000644 00000001764 15167731775 0010323 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var isArray = require('../internals/is-array');
var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Safari < 13 does not throw an error in this case
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
// makes no sense without proper strict mode support
if (this !== undefined) return true;
try {
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty([], 'length', { writable: false }).length = 1;
} catch (error) {
return error instanceof TypeError;
}
}();
module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
throw new $TypeError('Cannot set read only .length');
} return O.length = length;
} : function (O, length) {
return O.length = length;
};
safe-get-built-in.js 0000644 00000000726 15167731775 0010346 0 ustar 00 'use strict';
var global = require('../internals/global');
var DESCRIPTORS = require('../internals/descriptors');
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Avoid NodeJS experimental warning
module.exports = function (name) {
if (!DESCRIPTORS) return global[name];
var descriptor = getOwnPropertyDescriptor(global, name);
return descriptor && descriptor.value;
};
math-trunc.js 0000644 00000000434 15167731775 0007210 0 ustar 00 'use strict';
var ceil = Math.ceil;
var floor = Math.floor;
// `Math.trunc` method
// https://tc39.es/ecma262/#sec-math.trunc
// eslint-disable-next-line es/no-math-trunc -- safe
module.exports = Math.trunc || function trunc(x) {
var n = +x;
return (n > 0 ? floor : ceil)(n);
};
try-to-string.js 0000644 00000000242 15167731775 0007665 0 ustar 00 'use strict';
var $String = String;
module.exports = function (argument) {
try {
return $String(argument);
} catch (error) {
return 'Object';
}
};
is-array.js 0000644 00000000454 15167731775 0006657 0 ustar 00 'use strict';
var classof = require('../internals/classof-raw');
// `IsArray` abstract operation
// https://tc39.es/ecma262/#sec-isarray
// eslint-disable-next-line es/no-array-isarray -- safe
module.exports = Array.isArray || function isArray(argument) {
return classof(argument) === 'Array';
};
engine-ff-version.js 0000644 00000000250 15167731775 0010443 0 ustar 00 'use strict';
var userAgent = require('../internals/engine-user-agent');
var firefox = userAgent.match(/firefox\/(\d+)/i);
module.exports = !!firefox && +firefox[1];
string-punycode-to-ascii.js 0000644 00000012701 15167731775 0011766 0 ustar 00 'use strict';
// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
var uncurryThis = require('../internals/function-uncurry-this');
var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128; // 0x80
var delimiter = '-'; // '\x2D'
var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
var baseMinusTMin = base - tMin;
var $RangeError = RangeError;
var exec = uncurryThis(regexSeparators.exec);
var floor = Math.floor;
var fromCharCode = String.fromCharCode;
var charCodeAt = uncurryThis(''.charCodeAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var split = uncurryThis(''.split);
var toLowerCase = uncurryThis(''.toLowerCase);
/**
* Creates an array containing the numeric code points of each Unicode
* character in the string. While JavaScript uses UCS-2 internally,
* this function will convert a pair of surrogate halves (each of which
* UCS-2 exposes as separate characters) into a single code point,
* matching UTF-16.
*/
var ucs2decode = function (string) {
var output = [];
var counter = 0;
var length = string.length;
while (counter < length) {
var value = charCodeAt(string, counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// It's a high surrogate, and there is a next character.
var extra = charCodeAt(string, counter++);
if ((extra & 0xFC00) === 0xDC00) { // Low surrogate.
push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
// It's an unmatched surrogate; only append this code unit, in case the
// next code unit is the high surrogate of a surrogate pair.
push(output, value);
counter--;
}
} else {
push(output, value);
}
}
return output;
};
/**
* Converts a digit/integer into a basic code point.
*/
var digitToBasic = function (digit) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26);
};
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
*/
var adapt = function (delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
while (delta > baseMinusTMin * tMax >> 1) {
delta = floor(delta / baseMinusTMin);
k += base;
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};
/**
* Converts a string of Unicode symbols (e.g. a domain name label) to a
* Punycode string of ASCII-only symbols.
*/
var encode = function (input) {
var output = [];
// Convert the input in UCS-2 to an array of Unicode code points.
input = ucs2decode(input);
// Cache the length.
var inputLength = input.length;
// Initialize the state.
var n = initialN;
var delta = 0;
var bias = initialBias;
var i, currentValue;
// Handle the basic code points.
for (i = 0; i < input.length; i++) {
currentValue = input[i];
if (currentValue < 0x80) {
push(output, fromCharCode(currentValue));
}
}
var basicLength = output.length; // number of basic code points.
var handledCPCount = basicLength; // number of code points that have been handled;
// Finish the basic string with a delimiter unless it's empty.
if (basicLength) {
push(output, delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handled already. Find the next larger one:
var m = maxInt;
for (i = 0; i < input.length; i++) {
currentValue = input[i];
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
var handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
throw new $RangeError(OVERFLOW_ERROR);
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (i = 0; i < input.length; i++) {
currentValue = input[i];
if (currentValue < n && ++delta > maxInt) {
throw new $RangeError(OVERFLOW_ERROR);
}
if (currentValue === n) {
// Represent delta as a generalized variable-length integer.
var q = delta;
var k = base;
while (true) {
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
if (q < t) break;
var qMinusT = q - t;
var baseMinusT = base - t;
push(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
q = floor(qMinusT / baseMinusT);
k += base;
}
push(output, fromCharCode(digitToBasic(q)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
handledCPCount++;
}
}
delta++;
n++;
}
return join(output, '');
};
module.exports = function (input) {
var encoded = [];
var labels = split(replace(toLowerCase(input), regexSeparators, '\u002E'), '.');
var i, label;
for (i = 0; i < labels.length; i++) {
label = labels[i];
push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label);
}
return join(encoded, '.');
};
try-node-require.js 0000644 00000000417 15167731775 0010342 0 ustar 00 'use strict';
var IS_NODE = require('../internals/engine-is-node');
module.exports = function (name) {
try {
// eslint-disable-next-line no-new-func -- safe
if (IS_NODE) return Function('return require("' + name + '")')();
} catch (error) { /* empty */ }
};
array-slice.js 0000644 00000000170 15167731775 0007336 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
module.exports = uncurryThis([].slice);
wrap-error-constructor-with-cause.js 0000644 00000005625 15167731775 0013667 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var hasOwn = require('../internals/has-own-property');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var setPrototypeOf = require('../internals/object-set-prototype-of');
var copyConstructorProperties = require('../internals/copy-constructor-properties');
var proxyAccessor = require('../internals/proxy-accessor');
var inheritIfRequired = require('../internals/inherit-if-required');
var normalizeStringArgument = require('../internals/normalize-string-argument');
var installErrorCause = require('../internals/install-error-cause');
var installErrorStack = require('../internals/error-stack-install');
var DESCRIPTORS = require('../internals/descriptors');
var IS_PURE = require('../internals/is-pure');
module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
var STACK_TRACE_LIMIT = 'stackTraceLimit';
var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
var path = FULL_NAME.split('.');
var ERROR_NAME = path[path.length - 1];
var OriginalError = getBuiltIn.apply(null, path);
if (!OriginalError) return;
var OriginalErrorPrototype = OriginalError.prototype;
// V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
if (!FORCED) return OriginalError;
var BaseError = getBuiltIn('Error');
var WrappedError = wrapper(function (a, b) {
var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
installErrorStack(result, WrappedError, result.stack, 2);
if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
return result;
});
WrappedError.prototype = OriginalErrorPrototype;
if (ERROR_NAME !== 'Error') {
if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
else copyConstructorProperties(WrappedError, BaseError, { name: true });
} else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
}
copyConstructorProperties(WrappedError, OriginalError);
if (!IS_PURE) try {
// Safari 13- bug: WebAssembly errors does not have a proper `.name`
if (OriginalErrorPrototype.name !== ERROR_NAME) {
createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
}
OriginalErrorPrototype.constructor = WrappedError;
} catch (error) { /* empty */ }
return WrappedError;
};
math-sign.js 0000644 00000000500 15167731775 0007007 0 ustar 00 'use strict';
// `Math.sign` method implementation
// https://tc39.es/ecma262/#sec-math.sign
// eslint-disable-next-line es/no-math-sign -- safe
module.exports = Math.sign || function sign(x) {
var n = +x;
// eslint-disable-next-line no-self-compare -- NaN check
return n === 0 || n !== n ? n : n < 0 ? -1 : 1;
};
collection-from.js 0000644 00000001612 15167731775 0010221 0 ustar 00 'use strict';
// https://tc39.github.io/proposal-setmap-offrom/
var bind = require('../internals/function-bind-context');
var anObject = require('../internals/an-object');
var toObject = require('../internals/to-object');
var iterate = require('../internals/iterate');
module.exports = function (C, adder, ENTRY) {
return function from(source /* , mapFn, thisArg */) {
var O = toObject(source);
var length = arguments.length;
var mapFn = length > 1 ? arguments[1] : undefined;
var mapping = mapFn !== undefined;
var boundFunction = mapping ? bind(mapFn, length > 2 ? arguments[2] : undefined) : undefined;
var result = new C();
var n = 0;
iterate(O, function (nextItem) {
var entry = mapping ? boundFunction(nextItem, n++) : nextItem;
if (ENTRY) adder(result, anObject(entry)[0], entry[1]);
else adder(result, entry);
});
return result;
};
};
to-positive-integer.js 0000644 00000000443 15167731775 0011043 0 ustar 00 'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var $RangeError = RangeError;
module.exports = function (it) {
var result = toIntegerOrInfinity(it);
if (result < 0) throw new $RangeError("The argument can't be less than 0");
return result;
};
to-absolute-index.js 0000644 00000000745 15167731775 0010476 0 ustar 00 'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var max = Math.max;
var min = Math.min;
// Helper for a popular repeating case of the spec:
// Let integer be ? ToInteger(index).
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
module.exports = function (index, length) {
var integer = toIntegerOrInfinity(index);
return integer < 0 ? max(integer + length, 0) : min(integer, length);
};
math-log10.js 0000644 00000000302 15167731775 0006771 0 ustar 00 'use strict';
var log = Math.log;
var LOG10E = Math.LOG10E;
// eslint-disable-next-line es/no-math-log10 -- safe
module.exports = Math.log10 || function log10(x) {
return log(x) * LOG10E;
};
iterator-create-constructor.js 0000644 00000001413 15167731775 0012601 0 ustar 00 'use strict';
var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
var create = require('../internals/object-create');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
var setToStringTag = require('../internals/set-to-string-tag');
var Iterators = require('../internals/iterators');
var returnThis = function () { return this; };
module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
var TO_STRING_TAG = NAME + ' Iterator';
IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
Iterators[TO_STRING_TAG] = returnThis;
return IteratorConstructor;
};
is-integral-number.js 0000644 00000000554 15167731775 0010635 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
var floor = Math.floor;
// `IsIntegralNumber` abstract operation
// https://tc39.es/ecma262/#sec-isintegralnumber
// eslint-disable-next-line es/no-number-isinteger -- safe
module.exports = Number.isInteger || function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};
object-iterator.js 0000644 00000002637 15167731775 0010232 0 ustar 00 'use strict';
var InternalStateModule = require('../internals/internal-state');
var createIteratorConstructor = require('../internals/iterator-create-constructor');
var createIterResultObject = require('../internals/create-iter-result-object');
var hasOwn = require('../internals/has-own-property');
var objectKeys = require('../internals/object-keys');
var toObject = require('../internals/to-object');
var OBJECT_ITERATOR = 'Object Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(OBJECT_ITERATOR);
module.exports = createIteratorConstructor(function ObjectIterator(source, mode) {
var object = toObject(source);
setInternalState(this, {
type: OBJECT_ITERATOR,
mode: mode,
object: object,
keys: objectKeys(object),
index: 0
});
}, 'Object', function next() {
var state = getInternalState(this);
var keys = state.keys;
while (true) {
if (keys === null || state.index >= keys.length) {
state.object = state.keys = null;
return createIterResultObject(undefined, true);
}
var key = keys[state.index++];
var object = state.object;
if (!hasOwn(object, key)) continue;
switch (state.mode) {
case 'keys': return createIterResultObject(key, false);
case 'values': return createIterResultObject(object[key], false);
} /* entries */ return createIterResultObject([key, object[key]], false);
}
});
promise-native-constructor.js 0000644 00000000135 15167731775 0012451 0 ustar 00 'use strict';
var global = require('../internals/global');
module.exports = global.Promise;
classof.js 0000644 00000002106 15167731775 0006556 0 ustar 00 'use strict';
var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
var isCallable = require('../internals/is-callable');
var classofRaw = require('../internals/classof-raw');
var wellKnownSymbol = require('../internals/well-known-symbol');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $Object = Object;
// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (error) { /* empty */ }
};
// getting tag from ES6+ `Object.prototype.toString`
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
var O, tag, result;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
// builtinTag case
: CORRECT_ARGUMENTS ? classofRaw(O)
// ES3 arguments fallback
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
};
normalize-string-argument.js 0000644 00000000322 15167731775 0012246 0 ustar 00 'use strict';
var toString = require('../internals/to-string');
module.exports = function (argument, $default) {
return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
};
function-uncurry-this-clause.js 0000644 00000000547 15167731775 0012704 0 ustar 00 'use strict';
var classofRaw = require('../internals/classof-raw');
var uncurryThis = require('../internals/function-uncurry-this');
module.exports = function (fn) {
// Nashorn bug:
// https://github.com/zloirock/core-js/issues/1128
// https://github.com/zloirock/core-js/issues/1130
if (classofRaw(fn) === 'Function') return uncurryThis(fn);
};
length-of-array-like.js 0000644 00000000341 15167731775 0011044 0 ustar 00 'use strict';
var toLength = require('../internals/to-length');
// `LengthOfArrayLike` abstract operation
// https://tc39.es/ecma262/#sec-lengthofarraylike
module.exports = function (obj) {
return toLength(obj.length);
};
set-clone.js 0000644 00000000467 15167731775 0007025 0 ustar 00 'use strict';
var SetHelpers = require('../internals/set-helpers');
var iterate = require('../internals/set-iterate');
var Set = SetHelpers.Set;
var add = SetHelpers.add;
module.exports = function (set) {
var result = new Set();
iterate(set, function (it) {
add(result, it);
});
return result;
};
weak-map-helpers.js 0000644 00000000424 15167731775 0010267 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var caller = require('../internals/caller');
module.exports = {
WeakMap: getBuiltIn('WeakMap'),
set: caller('set', 2),
get: caller('get', 1),
has: caller('has', 1),
remove: caller('delete', 1)
};
function-demethodize.js 0000644 00000000330 15167731775 0011245 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
module.exports = function demethodize() {
return uncurryThis(aCallable(this));
};
ie8-dom-define.js 0000644 00000000735 15167731775 0007624 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var fails = require('../internals/fails');
var createElement = require('../internals/document-create-element');
// Thanks to IE8 for its funny defineProperty
module.exports = !DESCRIPTORS && !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(createElement('div'), 'a', {
get: function () { return 7; }
}).a !== 7;
});
engine-is-browser.js 0000644 00000000342 15167731775 0010463 0 ustar 00 'use strict';
var IS_DENO = require('../internals/engine-is-deno');
var IS_NODE = require('../internals/engine-is-node');
module.exports = !IS_DENO && !IS_NODE
&& typeof window == 'object'
&& typeof document == 'object';
get-iterator.js 0000644 00000001154 15167731775 0007534 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var aCallable = require('../internals/a-callable');
var anObject = require('../internals/an-object');
var tryToString = require('../internals/try-to-string');
var getIteratorMethod = require('../internals/get-iterator-method');
var $TypeError = TypeError;
module.exports = function (argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
throw new $TypeError(tryToString(argument) + ' is not iterable');
};
regexp-exec.js 0000644 00000000051 15167731775 0007335 0 ustar 00 'use strict';
module.exports = /./.exec;
regexp-sticky-helpers.js 0000644 00000000011 15167731775 0011353 0 ustar 00 // empty
async-iterator-prototype.js 0000644 00000003203 15167731775 0012132 0 ustar 00 'use strict';
var global = require('../internals/global');
var shared = require('../internals/shared-store');
var isCallable = require('../internals/is-callable');
var create = require('../internals/object-create');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var defineBuiltIn = require('../internals/define-built-in');
var wellKnownSymbol = require('../internals/well-known-symbol');
var IS_PURE = require('../internals/is-pure');
var USE_FUNCTION_CONSTRUCTOR = 'USE_FUNCTION_CONSTRUCTOR';
var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
var AsyncIterator = global.AsyncIterator;
var PassedAsyncIteratorPrototype = shared.AsyncIteratorPrototype;
var AsyncIteratorPrototype, prototype;
if (PassedAsyncIteratorPrototype) {
AsyncIteratorPrototype = PassedAsyncIteratorPrototype;
} else if (isCallable(AsyncIterator)) {
AsyncIteratorPrototype = AsyncIterator.prototype;
} else if (shared[USE_FUNCTION_CONSTRUCTOR] || global[USE_FUNCTION_CONSTRUCTOR]) {
try {
// eslint-disable-next-line no-new-func -- we have no alternatives without usage of modern syntax
prototype = getPrototypeOf(getPrototypeOf(getPrototypeOf(Function('return async function*(){}()')())));
if (getPrototypeOf(prototype) === Object.prototype) AsyncIteratorPrototype = prototype;
} catch (error) { /* empty */ }
}
if (!AsyncIteratorPrototype) AsyncIteratorPrototype = {};
else if (IS_PURE) AsyncIteratorPrototype = create(AsyncIteratorPrototype);
if (!isCallable(AsyncIteratorPrototype[ASYNC_ITERATOR])) {
defineBuiltIn(AsyncIteratorPrototype, ASYNC_ITERATOR, function () {
return this;
});
}
module.exports = AsyncIteratorPrototype;
object-define-property.js 0000644 00000003547 15167731775 0011516 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');
var anObject = require('../internals/an-object');
var toPropertyKey = require('../internals/to-property-key');
var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var $defineProperty = Object.defineProperty;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = 'enumerable';
var CONFIGURABLE = 'configurable';
var WRITABLE = 'writable';
// `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
var current = $getOwnPropertyDescriptor(O, P);
if (current && current[WRITABLE]) {
O[P] = Attributes.value;
Attributes = {
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
} return $defineProperty(O, P, Attributes);
} : $defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return $defineProperty(O, P, Attributes);
} catch (error) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
iterator-indexed.js 0000644 00000000544 15167731775 0010377 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var map = require('../internals/iterator-map');
var callback = function (value, counter) {
return [counter, value];
};
// `Iterator.prototype.indexed` method
// https://github.com/tc39/proposal-iterator-helpers
module.exports = function indexed() {
return call(map, this, callback);
};
freezing.js 0000644 00000000420 15167731775 0006732 0 ustar 00 'use strict';
var fails = require('../internals/fails');
module.exports = !fails(function () {
// eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
return Object.isExtensible(Object.preventExtensions({}));
});
async-from-sync-iterator.js 0000644 00000003660 15167731775 0012011 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var create = require('../internals/object-create');
var getMethod = require('../internals/get-method');
var defineBuiltIns = require('../internals/define-built-ins');
var InternalStateModule = require('../internals/internal-state');
var getBuiltIn = require('../internals/get-built-in');
var AsyncIteratorPrototype = require('../internals/async-iterator-prototype');
var createIterResultObject = require('../internals/create-iter-result-object');
var Promise = getBuiltIn('Promise');
var ASYNC_FROM_SYNC_ITERATOR = 'AsyncFromSyncIterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ASYNC_FROM_SYNC_ITERATOR);
var asyncFromSyncIteratorContinuation = function (result, resolve, reject) {
var done = result.done;
Promise.resolve(result.value).then(function (value) {
resolve(createIterResultObject(value, done));
}, reject);
};
var AsyncFromSyncIterator = function AsyncIterator(iteratorRecord) {
iteratorRecord.type = ASYNC_FROM_SYNC_ITERATOR;
setInternalState(this, iteratorRecord);
};
AsyncFromSyncIterator.prototype = defineBuiltIns(create(AsyncIteratorPrototype), {
next: function next() {
var state = getInternalState(this);
return new Promise(function (resolve, reject) {
var result = anObject(call(state.next, state.iterator));
asyncFromSyncIteratorContinuation(result, resolve, reject);
});
},
'return': function () {
var iterator = getInternalState(this).iterator;
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));
asyncFromSyncIteratorContinuation(result, resolve, reject);
});
}
});
module.exports = AsyncFromSyncIterator;
species-constructor.js 0000644 00000001136 15167731775 0011144 0 ustar 00 'use strict';
var anObject = require('../internals/an-object');
var aConstructor = require('../internals/a-constructor');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var wellKnownSymbol = require('../internals/well-known-symbol');
var SPECIES = wellKnownSymbol('species');
// `SpeciesConstructor` abstract operation
// https://tc39.es/ecma262/#sec-speciesconstructor
module.exports = function (O, defaultConstructor) {
var C = anObject(O).constructor;
var S;
return C === undefined || isNullOrUndefined(S = anObject(C)[SPECIES]) ? defaultConstructor : aConstructor(S);
};
shared-key.js 0000644 00000000322 15167731775 0007156 0 ustar 00 'use strict';
var shared = require('../internals/shared');
var uid = require('../internals/uid');
var keys = shared('keys');
module.exports = function (key) {
return keys[key] || (keys[key] = uid(key));
};
a-weak-set.js 0000644 00000000525 15167731775 0007065 0 ustar 00 'use strict';
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
// Perform ? RequireInternalSlot(M, [[WeakSetData]])
module.exports = function (it) {
if (typeof it == 'object' && 'has' in it && 'add' in it && 'delete' in it) return it;
throw new $TypeError(tryToString(it) + ' is not a weakset');
};
is-callable.js 0000644 00000001025 15167731775 0007273 0 ustar 00 'use strict';
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
var documentAll = typeof document == 'object' && document.all;
// `IsCallable` abstract operation
// https://tc39.es/ecma262/#sec-iscallable
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
return typeof argument == 'function' || argument === documentAll;
} : function (argument) {
return typeof argument == 'function';
};
get-built-in-prototype-method.js 0000644 00000000723 15167731775 0012750 0 ustar 00 'use strict';
var global = require('../internals/global');
var path = require('../internals/path');
module.exports = function (CONSTRUCTOR, METHOD) {
var Namespace = path[CONSTRUCTOR + 'Prototype'];
var pureMethod = Namespace && Namespace[METHOD];
if (pureMethod) return pureMethod;
var NativeConstructor = global[CONSTRUCTOR];
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
return NativePrototype && NativePrototype[METHOD];
};
array-iteration-from-last.js 0000644 00000002260 15167731775 0012141 0 ustar 00 'use strict';
var bind = require('../internals/function-bind-context');
var IndexedObject = require('../internals/indexed-object');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
// `Array.prototype.{ findLast, findLastIndex }` methods implementation
var createMethod = function (TYPE) {
var IS_FIND_LAST_INDEX = TYPE === 1;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IndexedObject(O);
var index = lengthOfArrayLike(self);
var boundFunction = bind(callbackfn, that);
var value, result;
while (index-- > 0) {
value = self[index];
result = boundFunction(value, index, O);
if (result) switch (TYPE) {
case 0: return value; // findLast
case 1: return index; // findLastIndex
}
}
return IS_FIND_LAST_INDEX ? -1 : undefined;
};
};
module.exports = {
// `Array.prototype.findLast` method
// https://github.com/tc39/proposal-array-find-from-last
findLast: createMethod(0),
// `Array.prototype.findLastIndex` method
// https://github.com/tc39/proposal-array-find-from-last
findLastIndex: createMethod(1)
};
own-keys.js 0000644 00000001336 15167731775 0006704 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var uncurryThis = require('../internals/function-uncurry-this');
var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');
var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
var anObject = require('../internals/an-object');
var concat = uncurryThis([].concat);
// all object keys, includes non-enumerable and symbols
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
var keys = getOwnPropertyNamesModule.f(anObject(it));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
};
collection-strong.js 0000644 00000017521 15167731775 0010600 0 ustar 00 'use strict';
var create = require('../internals/object-create');
var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
var defineBuiltIns = require('../internals/define-built-ins');
var bind = require('../internals/function-bind-context');
var anInstance = require('../internals/an-instance');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var iterate = require('../internals/iterate');
var defineIterator = require('../internals/iterator-define');
var createIterResultObject = require('../internals/create-iter-result-object');
var setSpecies = require('../internals/set-species');
var DESCRIPTORS = require('../internals/descriptors');
var fastKey = require('../internals/internal-metadata').fastKey;
var InternalStateModule = require('../internals/internal-state');
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
module.exports = {
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function (that, iterable) {
anInstance(that, Prototype);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
index: create(null),
first: undefined,
last: undefined,
size: 0
});
if (!DESCRIPTORS) that.size = 0;
if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define = function (that, key, value) {
var state = getInternalState(that);
var entry = getEntry(that, key);
var previous, index;
// change existing entry
if (entry) {
entry.value = value;
// create new entry
} else {
state.last = entry = {
index: index = fastKey(key, true),
key: key,
value: value,
previous: previous = state.last,
next: undefined,
removed: false
};
if (!state.first) state.first = entry;
if (previous) previous.next = entry;
if (DESCRIPTORS) state.size++;
else that.size++;
// add to index
if (index !== 'F') state.index[index] = entry;
} return that;
};
var getEntry = function (that, key) {
var state = getInternalState(that);
// fast case
var index = fastKey(key);
var entry;
if (index !== 'F') return state.index[index];
// frozen object case
for (entry = state.first; entry; entry = entry.next) {
if (entry.key === key) return entry;
}
};
defineBuiltIns(Prototype, {
// `{ Map, Set }.prototype.clear()` methods
// https://tc39.es/ecma262/#sec-map.prototype.clear
// https://tc39.es/ecma262/#sec-set.prototype.clear
clear: function clear() {
var that = this;
var state = getInternalState(that);
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous) entry.previous = entry.previous.next = undefined;
entry = entry.next;
}
state.first = state.last = undefined;
state.index = create(null);
if (DESCRIPTORS) state.size = 0;
else that.size = 0;
},
// `{ Map, Set }.prototype.delete(key)` methods
// https://tc39.es/ecma262/#sec-map.prototype.delete
// https://tc39.es/ecma262/#sec-set.prototype.delete
'delete': function (key) {
var that = this;
var state = getInternalState(that);
var entry = getEntry(that, key);
if (entry) {
var next = entry.next;
var prev = entry.previous;
delete state.index[entry.index];
entry.removed = true;
if (prev) prev.next = next;
if (next) next.previous = prev;
if (state.first === entry) state.first = next;
if (state.last === entry) state.last = prev;
if (DESCRIPTORS) state.size--;
else that.size--;
} return !!entry;
},
// `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
// https://tc39.es/ecma262/#sec-map.prototype.foreach
// https://tc39.es/ecma262/#sec-set.prototype.foreach
forEach: function forEach(callbackfn /* , that = undefined */) {
var state = getInternalState(this);
var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
var entry;
while (entry = entry ? entry.next : state.first) {
boundFunction(entry.value, entry.key, this);
// revert to the last existing entry
while (entry && entry.removed) entry = entry.previous;
}
},
// `{ Map, Set}.prototype.has(key)` methods
// https://tc39.es/ecma262/#sec-map.prototype.has
// https://tc39.es/ecma262/#sec-set.prototype.has
has: function has(key) {
return !!getEntry(this, key);
}
});
defineBuiltIns(Prototype, IS_MAP ? {
// `Map.prototype.get(key)` method
// https://tc39.es/ecma262/#sec-map.prototype.get
get: function get(key) {
var entry = getEntry(this, key);
return entry && entry.value;
},
// `Map.prototype.set(key, value)` method
// https://tc39.es/ecma262/#sec-map.prototype.set
set: function set(key, value) {
return define(this, key === 0 ? 0 : key, value);
}
} : {
// `Set.prototype.add(value)` method
// https://tc39.es/ecma262/#sec-set.prototype.add
add: function add(value) {
return define(this, value = value === 0 ? 0 : value, value);
}
});
if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', {
configurable: true,
get: function () {
return getInternalState(this).size;
}
});
return Constructor;
},
setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
// `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
// https://tc39.es/ecma262/#sec-map.prototype.entries
// https://tc39.es/ecma262/#sec-map.prototype.keys
// https://tc39.es/ecma262/#sec-map.prototype.values
// https://tc39.es/ecma262/#sec-map.prototype-@@iterator
// https://tc39.es/ecma262/#sec-set.prototype.entries
// https://tc39.es/ecma262/#sec-set.prototype.keys
// https://tc39.es/ecma262/#sec-set.prototype.values
// https://tc39.es/ecma262/#sec-set.prototype-@@iterator
defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
setInternalState(this, {
type: ITERATOR_NAME,
target: iterated,
state: getInternalCollectionState(iterated),
kind: kind,
last: undefined
});
}, function () {
var state = getInternalIteratorState(this);
var kind = state.kind;
var entry = state.last;
// revert to the last existing entry
while (entry && entry.removed) entry = entry.previous;
// get next entry
if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
// or finish the iteration
state.target = undefined;
return createIterResultObject(undefined, true);
}
// return step by kind
if (kind === 'keys') return createIterResultObject(entry.key, false);
if (kind === 'values') return createIterResultObject(entry.value, false);
return createIterResultObject([entry.key, entry.value], false);
}, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
// `{ Map, Set }.prototype[@@species]` accessors
// https://tc39.es/ecma262/#sec-get-map-@@species
// https://tc39.es/ecma262/#sec-get-set-@@species
setSpecies(CONSTRUCTOR_NAME);
}
};
define-built-ins.js 0000644 00000000460 15167731775 0010263 0 ustar 00 'use strict';
var defineBuiltIn = require('../internals/define-built-in');
module.exports = function (target, src, options) {
for (var key in src) {
if (options && options.unsafe && target[key]) target[key] = src[key];
else defineBuiltIn(target, key, src[key], options);
} return target;
};
array-iteration.js 0000644 00000005562 15167731775 0010247 0 ustar 00 'use strict';
var bind = require('../internals/function-bind-context');
var uncurryThis = require('../internals/function-uncurry-this');
var IndexedObject = require('../internals/indexed-object');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var arraySpeciesCreate = require('../internals/array-species-create');
var push = uncurryThis([].push);
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
var createMethod = function (TYPE) {
var IS_MAP = TYPE === 1;
var IS_FILTER = TYPE === 2;
var IS_SOME = TYPE === 3;
var IS_EVERY = TYPE === 4;
var IS_FIND_INDEX = TYPE === 6;
var IS_FILTER_REJECT = TYPE === 7;
var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject($this);
var self = IndexedObject(O);
var length = lengthOfArrayLike(self);
var boundFunction = bind(callbackfn, that);
var index = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
var value, result;
for (;length > index; index++) if (NO_HOLES || index in self) {
value = self[index];
result = boundFunction(value, index, O);
if (TYPE) {
if (IS_MAP) target[index] = result; // map
else if (result) switch (TYPE) {
case 3: return true; // some
case 5: return value; // find
case 6: return index; // findIndex
case 2: push(target, value); // filter
} else switch (TYPE) {
case 4: return false; // every
case 7: push(target, value); // filterReject
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
module.exports = {
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
forEach: createMethod(0),
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
map: createMethod(1),
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
filter: createMethod(2),
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
some: createMethod(3),
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
every: createMethod(4),
// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
find: createMethod(5),
// `Array.prototype.findIndex` method
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod(6),
// `Array.prototype.filterReject` method
// https://github.com/tc39/proposal-array-filtering
filterReject: createMethod(7)
};
engine-is-bun.js 0000644 00000000177 15167731775 0007572 0 ustar 00 'use strict';
/* global Bun -- Bun case */
module.exports = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
host-report-errors.js 0000644 00000000326 15167731775 0010726 0 ustar 00 'use strict';
module.exports = function (a, b) {
try {
// eslint-disable-next-line no-console -- safe
arguments.length === 1 ? console.error(a) : console.error(a, b);
} catch (error) { /* empty */ }
};
array-sort.js 0000644 00000002055 15167731775 0007232 0 ustar 00 'use strict';
var arraySlice = require('../internals/array-slice');
var floor = Math.floor;
var sort = function (array, comparefn) {
var length = array.length;
if (length < 8) {
// insertion sort
var i = 1;
var element, j;
while (i < length) {
j = i;
element = array[i];
while (j && comparefn(array[j - 1], element) > 0) {
array[j] = array[--j];
}
if (j !== i++) array[j] = element;
}
} else {
// merge sort
var middle = floor(length / 2);
var left = sort(arraySlice(array, 0, middle), comparefn);
var right = sort(arraySlice(array, middle), comparefn);
var llength = left.length;
var rlength = right.length;
var lindex = 0;
var rindex = 0;
while (lindex < llength || rindex < rlength) {
array[lindex + rindex] = (lindex < llength && rindex < rlength)
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
: lindex < llength ? left[lindex++] : right[rindex++];
}
}
return array;
};
module.exports = sort;
is-symbol.js 0000644 00000000773 15167731775 0007052 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var isCallable = require('../internals/is-callable');
var isPrototypeOf = require('../internals/object-is-prototype-of');
var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
var $Object = Object;
module.exports = USE_SYMBOL_AS_UID ? function (it) {
return typeof it == 'symbol';
} : function (it) {
var $Symbol = getBuiltIn('Symbol');
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
};
async-iterator-iteration.js 0000644 00000006375 15167731775 0012100 0 ustar 00 'use strict';
// https://github.com/tc39/proposal-iterator-helpers
// https://github.com/tc39/proposal-array-from-async
var call = require('../internals/function-call');
var aCallable = require('../internals/a-callable');
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
var getBuiltIn = require('../internals/get-built-in');
var getIteratorDirect = require('../internals/get-iterator-direct');
var closeAsyncIteration = require('../internals/async-iterator-close');
var createMethod = function (TYPE) {
var IS_TO_ARRAY = TYPE === 0;
var IS_FOR_EACH = TYPE === 1;
var IS_EVERY = TYPE === 2;
var IS_SOME = TYPE === 3;
return function (object, fn, target) {
anObject(object);
var MAPPING = fn !== undefined;
if (MAPPING || !IS_TO_ARRAY) aCallable(fn);
var record = getIteratorDirect(object);
var Promise = getBuiltIn('Promise');
var iterator = record.iterator;
var next = record.next;
var counter = 0;
return new Promise(function (resolve, reject) {
var ifAbruptCloseAsyncIterator = function (error) {
closeAsyncIteration(iterator, reject, error, reject);
};
var loop = function () {
try {
if (MAPPING) try {
doesNotExceedSafeInteger(counter);
} catch (error5) { ifAbruptCloseAsyncIterator(error5); }
Promise.resolve(anObject(call(next, iterator))).then(function (step) {
try {
if (anObject(step).done) {
if (IS_TO_ARRAY) {
target.length = counter;
resolve(target);
} else resolve(IS_SOME ? false : IS_EVERY || undefined);
} else {
var value = step.value;
try {
if (MAPPING) {
var result = fn(value, counter);
var handler = function ($result) {
if (IS_FOR_EACH) {
loop();
} else if (IS_EVERY) {
$result ? loop() : closeAsyncIteration(iterator, resolve, false, reject);
} else if (IS_TO_ARRAY) {
try {
target[counter++] = $result;
loop();
} catch (error4) { ifAbruptCloseAsyncIterator(error4); }
} else {
$result ? closeAsyncIteration(iterator, resolve, IS_SOME || value, reject) : loop();
}
};
if (isObject(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator);
else handler(result);
} else {
target[counter++] = value;
loop();
}
} catch (error3) { ifAbruptCloseAsyncIterator(error3); }
}
} catch (error2) { reject(error2); }
}, reject);
} catch (error) { reject(error); }
};
loop();
});
};
};
module.exports = {
toArray: createMethod(0),
forEach: createMethod(1),
every: createMethod(2),
some: createMethod(3),
find: createMethod(4)
};
create-property.js 0000644 00000000620 15167731775 0010250 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var definePropertyModule = require('../internals/object-define-property');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
module.exports = function (object, key, value) {
if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
else object[key] = value;
};
has-own-property.js 0000644 00000000662 15167731775 0010367 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toObject = require('../internals/to-object');
var hasOwnProperty = uncurryThis({}.hasOwnProperty);
// `HasOwnProperty` abstract operation
// https://tc39.es/ecma262/#sec-hasownproperty
// eslint-disable-next-line es/no-object-hasown -- safe
module.exports = Object.hasOwn || function hasOwn(it, key) {
return hasOwnProperty(toObject(it), key);
};
array-buffer-view-core.js 0000644 00000000011 15167731775 0011400 0 ustar 00 // empty
collection-weak.js 0000644 00000010646 15167731775 0010214 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var defineBuiltIns = require('../internals/define-built-ins');
var getWeakData = require('../internals/internal-metadata').getWeakData;
var anInstance = require('../internals/an-instance');
var anObject = require('../internals/an-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var isObject = require('../internals/is-object');
var iterate = require('../internals/iterate');
var ArrayIterationModule = require('../internals/array-iteration');
var hasOwn = require('../internals/has-own-property');
var InternalStateModule = require('../internals/internal-state');
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
var find = ArrayIterationModule.find;
var findIndex = ArrayIterationModule.findIndex;
var splice = uncurryThis([].splice);
var id = 0;
// fallback for uncaught frozen keys
var uncaughtFrozenStore = function (state) {
return state.frozen || (state.frozen = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function () {
this.entries = [];
};
var findUncaughtFrozen = function (store, key) {
return find(store.entries, function (it) {
return it[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function (key) {
var entry = findUncaughtFrozen(this, key);
if (entry) return entry[1];
},
has: function (key) {
return !!findUncaughtFrozen(this, key);
},
set: function (key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry) entry[1] = value;
else this.entries.push([key, value]);
},
'delete': function (key) {
var index = findIndex(this.entries, function (it) {
return it[0] === key;
});
if (~index) splice(this.entries, index, 1);
return !!~index;
}
};
module.exports = {
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function (that, iterable) {
anInstance(that, Prototype);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
id: id++,
frozen: undefined
});
if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define = function (that, key, value) {
var state = getInternalState(that);
var data = getWeakData(anObject(key), true);
if (data === true) uncaughtFrozenStore(state).set(key, value);
else data[state.id] = value;
return that;
};
defineBuiltIns(Prototype, {
// `{ WeakMap, WeakSet }.prototype.delete(key)` methods
// https://tc39.es/ecma262/#sec-weakmap.prototype.delete
// https://tc39.es/ecma262/#sec-weakset.prototype.delete
'delete': function (key) {
var state = getInternalState(this);
if (!isObject(key)) return false;
var data = getWeakData(key);
if (data === true) return uncaughtFrozenStore(state)['delete'](key);
return data && hasOwn(data, state.id) && delete data[state.id];
},
// `{ WeakMap, WeakSet }.prototype.has(key)` methods
// https://tc39.es/ecma262/#sec-weakmap.prototype.has
// https://tc39.es/ecma262/#sec-weakset.prototype.has
has: function has(key) {
var state = getInternalState(this);
if (!isObject(key)) return false;
var data = getWeakData(key);
if (data === true) return uncaughtFrozenStore(state).has(key);
return data && hasOwn(data, state.id);
}
});
defineBuiltIns(Prototype, IS_MAP ? {
// `WeakMap.prototype.get(key)` method
// https://tc39.es/ecma262/#sec-weakmap.prototype.get
get: function get(key) {
var state = getInternalState(this);
if (isObject(key)) {
var data = getWeakData(key);
if (data === true) return uncaughtFrozenStore(state).get(key);
return data ? data[state.id] : undefined;
}
},
// `WeakMap.prototype.set(key, value)` method
// https://tc39.es/ecma262/#sec-weakmap.prototype.set
set: function set(key, value) {
return define(this, key, value);
}
} : {
// `WeakSet.prototype.add(value)` method
// https://tc39.es/ecma262/#sec-weakset.prototype.add
add: function add(value) {
return define(this, value, true);
}
});
return Constructor;
}
};
a-map.js 0000644 00000000577 15167731775 0006131 0 ustar 00 'use strict';
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
// Perform ? RequireInternalSlot(M, [[MapData]])
module.exports = function (it) {
if (typeof it == 'object' && 'size' in it && 'has' in it && 'get' in it && 'set' in it && 'delete' in it && 'entries' in it) return it;
throw new $TypeError(tryToString(it) + ' is not a map');
};
a-callable.js 0000644 00000000542 15167731775 0007103 0 ustar 00 'use strict';
var isCallable = require('../internals/is-callable');
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
// `Assert: IsCallable(argument) is true`
module.exports = function (argument) {
if (isCallable(argument)) return argument;
throw new $TypeError(tryToString(argument) + ' is not a function');
};
set-size.js 0000644 00000000106 15167731775 0006665 0 ustar 00 'use strict';
module.exports = function (set) {
return set.size;
};
iterator-close.js 0000644 00000001221 15167731775 0010055 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var getMethod = require('../internals/get-method');
module.exports = function (iterator, kind, value) {
var innerResult, innerError;
anObject(iterator);
try {
innerResult = getMethod(iterator, 'return');
if (!innerResult) {
if (kind === 'throw') throw value;
return value;
}
innerResult = call(innerResult, iterator);
} catch (error) {
innerError = true;
innerResult = error;
}
if (kind === 'throw') throw value;
if (innerError) throw innerResult;
anObject(innerResult);
return value;
};
uid.js 0000644 00000000444 15167731775 0005710 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1.0.toString);
module.exports = function (key) {
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
};
string-parse.js 0000644 00000006677 15167731775 0007563 0 ustar 00 'use strict';
// adapted from https://github.com/jridgewell/string-dedent
var getBuiltIn = require('../internals/get-built-in');
var uncurryThis = require('../internals/function-uncurry-this');
var fromCharCode = String.fromCharCode;
var fromCodePoint = getBuiltIn('String', 'fromCodePoint');
var charAt = uncurryThis(''.charAt);
var charCodeAt = uncurryThis(''.charCodeAt);
var stringIndexOf = uncurryThis(''.indexOf);
var stringSlice = uncurryThis(''.slice);
var ZERO_CODE = 48;
var NINE_CODE = 57;
var LOWER_A_CODE = 97;
var LOWER_F_CODE = 102;
var UPPER_A_CODE = 65;
var UPPER_F_CODE = 70;
var isDigit = function (str, index) {
var c = charCodeAt(str, index);
return c >= ZERO_CODE && c <= NINE_CODE;
};
var parseHex = function (str, index, end) {
if (end >= str.length) return -1;
var n = 0;
for (; index < end; index++) {
var c = hexToInt(charCodeAt(str, index));
if (c === -1) return -1;
n = n * 16 + c;
}
return n;
};
var hexToInt = function (c) {
if (c >= ZERO_CODE && c <= NINE_CODE) return c - ZERO_CODE;
if (c >= LOWER_A_CODE && c <= LOWER_F_CODE) return c - LOWER_A_CODE + 10;
if (c >= UPPER_A_CODE && c <= UPPER_F_CODE) return c - UPPER_A_CODE + 10;
return -1;
};
module.exports = function (raw) {
var out = '';
var start = 0;
// We need to find every backslash escape sequence, and cook the escape into a real char.
var i = 0;
var n;
while ((i = stringIndexOf(raw, '\\', i)) > -1) {
out += stringSlice(raw, start, i);
// If the backslash is the last char of the string, then it was an invalid sequence.
// This can't actually happen in a tagged template literal, but could happen if you manually
// invoked the tag with an array.
if (++i === raw.length) return;
var next = charAt(raw, i++);
switch (next) {
// Escaped control codes need to be individually processed.
case 'b':
out += '\b';
break;
case 't':
out += '\t';
break;
case 'n':
out += '\n';
break;
case 'v':
out += '\v';
break;
case 'f':
out += '\f';
break;
case 'r':
out += '\r';
break;
// Escaped line terminators just skip the char.
case '\r':
// Treat `\r\n` as a single terminator.
if (i < raw.length && charAt(raw, i) === '\n') ++i;
// break omitted
case '\n':
case '\u2028':
case '\u2029':
break;
// `\0` is a null control char, but `\0` followed by another digit is an illegal octal escape.
case '0':
if (isDigit(raw, i)) return;
out += '\0';
break;
// Hex escapes must contain 2 hex chars.
case 'x':
n = parseHex(raw, i, i + 2);
if (n === -1) return;
i += 2;
out += fromCharCode(n);
break;
// Unicode escapes contain either 4 chars, or an unlimited number between `{` and `}`.
// The hex value must not overflow 0x10FFFF.
case 'u':
if (i < raw.length && charAt(raw, i) === '{') {
var end = stringIndexOf(raw, '}', ++i);
if (end === -1) return;
n = parseHex(raw, i, end);
i = end + 1;
} else {
n = parseHex(raw, i, i + 4);
i += 4;
}
if (n === -1 || n > 0x10FFFF) return;
out += fromCodePoint(n);
break;
default:
if (isDigit(next, 0)) return;
out += next;
}
start = i;
}
return out + stringSlice(raw, start);
};
is-regexp.js 0000644 00000000703 15167731775 0007030 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
var classof = require('../internals/classof-raw');
var wellKnownSymbol = require('../internals/well-known-symbol');
var MATCH = wellKnownSymbol('match');
// `IsRegExp` abstract operation
// https://tc39.es/ecma262/#sec-isregexp
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
};
object-keys-internal.js 0000644 00000001322 15167731775 0011154 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var hasOwn = require('../internals/has-own-property');
var toIndexedObject = require('../internals/to-indexed-object');
var indexOf = require('../internals/array-includes').indexOf;
var hiddenKeys = require('../internals/hidden-keys');
var push = uncurryThis([].push);
module.exports = function (object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
// Don't enum bug & hidden keys
while (names.length > i) if (hasOwn(O, key = names[i++])) {
~indexOf(result, key) || push(result, key);
}
return result;
};
object-to-array.js 0000644 00000003210 15167731775 0010123 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var fails = require('../internals/fails');
var uncurryThis = require('../internals/function-uncurry-this');
var objectGetPrototypeOf = require('../internals/object-get-prototype-of');
var objectKeys = require('../internals/object-keys');
var toIndexedObject = require('../internals/to-indexed-object');
var $propertyIsEnumerable = require('../internals/object-property-is-enumerable').f;
var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
var push = uncurryThis([].push);
// in some IE versions, `propertyIsEnumerable` returns incorrect result on integer keys
// of `null` prototype objects
var IE_BUG = DESCRIPTORS && fails(function () {
// eslint-disable-next-line es/no-object-create -- safe
var O = Object.create(null);
O[2] = 2;
return !propertyIsEnumerable(O, 2);
});
// `Object.{ entries, values }` methods implementation
var createMethod = function (TO_ENTRIES) {
return function (it) {
var O = toIndexedObject(it);
var keys = objectKeys(O);
var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O) === null;
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) {
key = keys[i++];
if (!DESCRIPTORS || (IE_WORKAROUND ? key in O : propertyIsEnumerable(O, key))) {
push(result, TO_ENTRIES ? [key, O[key]] : O[key]);
}
}
return result;
};
};
module.exports = {
// `Object.entries` method
// https://tc39.es/ecma262/#sec-object.entries
entries: createMethod(true),
// `Object.values` method
// https://tc39.es/ecma262/#sec-object.values
values: createMethod(false)
};
define-built-in-accessor.js 0000644 00000000303 15167731775 0011674 0 ustar 00 'use strict';
var defineProperty = require('../internals/object-define-property');
module.exports = function (target, name, descriptor) {
return defineProperty.f(target, name, descriptor);
};
array-from-async.js 0000644 00000004433 15167731775 0010323 0 ustar 00 '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');
var getAsyncIterator = require('../internals/get-async-iterator');
var getIterator = require('../internals/get-iterator');
var getIteratorDirect = require('../internals/get-iterator-direct');
var getIteratorMethod = require('../internals/get-iterator-method');
var getMethod = require('../internals/get-method');
var getBuiltIn = require('../internals/get-built-in');
var getBuiltInPrototypeMethod = require('../internals/get-built-in-prototype-method');
var wellKnownSymbol = require('../internals/well-known-symbol');
var AsyncFromSyncIterator = require('../internals/async-from-sync-iterator');
var toArray = require('../internals/async-iterator-iteration').toArray;
var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
var arrayIterator = uncurryThis(getBuiltInPrototypeMethod('Array', 'values'));
var arrayIteratorNext = uncurryThis(arrayIterator([]).next);
var safeArrayIterator = function () {
return new SafeArrayIterator(this);
};
var SafeArrayIterator = function (O) {
this.iterator = arrayIterator(O);
};
SafeArrayIterator.prototype.next = function () {
return arrayIteratorNext(this.iterator);
};
// `Array.fromAsync` method implementation
// https://github.com/tc39/proposal-array-from-async
module.exports = function fromAsync(asyncItems /* , mapfn = undefined, thisArg = undefined */) {
var C = this;
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var thisArg = argumentsLength > 2 ? arguments[2] : undefined;
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 A = isConstructor(C) ? new C() : [];
var iterator = usingAsyncIterator
? getAsyncIterator(O, usingAsyncIterator)
: new AsyncFromSyncIterator(getIteratorDirect(getIterator(O, usingSyncIterator)));
resolve(toArray(iterator, mapfn, A));
});
};
regexp-flags.js 0000644 00000001062 15167731775 0007510 0 ustar 00 'use strict';
var anObject = require('../internals/an-object');
// `RegExp.prototype.flags` getter implementation
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.hasIndices) result += 'd';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.dotAll) result += 's';
if (that.unicode) result += 'u';
if (that.unicodeSets) result += 'v';
if (that.sticky) result += 'y';
return result;
};
perform.js 0000644 00000000252 15167731775 0006576 0 ustar 00 'use strict';
module.exports = function (exec) {
try {
return { error: false, value: exec() };
} catch (error) {
return { error: true, value: error };
}
};
iterators.js 0000644 00000000043 15167731775 0007136 0 ustar 00 'use strict';
module.exports = {};
weak-set-helpers.js 0000644 00000000373 15167731775 0010310 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var caller = require('../internals/caller');
module.exports = {
WeakSet: getBuiltIn('WeakSet'),
add: caller('add', 1),
has: caller('has', 1),
remove: caller('delete', 1)
};
get-async-iterator-flattenable.js 0000644 00000002067 15167731775 0013132 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var isCallable = require('../internals/is-callable');
var anObject = require('../internals/an-object');
var getIteratorDirect = require('../internals/get-iterator-direct');
var getIteratorMethod = require('../internals/get-iterator-method');
var getMethod = require('../internals/get-method');
var wellKnownSymbol = require('../internals/well-known-symbol');
var AsyncFromSyncIterator = require('../internals/async-from-sync-iterator');
var ASYNC_ITERATOR = wellKnownSymbol('asyncIterator');
module.exports = function (obj) {
var object = anObject(obj);
var alreadyAsync = true;
var method = getMethod(object, ASYNC_ITERATOR);
var iterator;
if (!isCallable(method)) {
method = getIteratorMethod(object);
alreadyAsync = false;
}
if (method !== undefined) {
iterator = call(method, object);
} else {
iterator = object;
alreadyAsync = true;
}
anObject(iterator);
return getIteratorDirect(alreadyAsync ? iterator : new AsyncFromSyncIterator(getIteratorDirect(iterator)));
};
indexed-object.js 0000644 00000001160 15167731775 0010007 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var fails = require('../internals/fails');
var classof = require('../internals/classof-raw');
var $Object = Object;
var split = uncurryThis(''.split);
// fallback for non-array-like ES3 and non-enumerable old V8 strings
module.exports = fails(function () {
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins -- safe
return !$Object('z').propertyIsEnumerable(0);
}) ? function (it) {
return classof(it) === 'String' ? split(it, '') : $Object(it);
} : $Object;
regexp-exec-abstract.js 0000644 00000001274 15167731775 0011146 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var isCallable = require('../internals/is-callable');
var classof = require('../internals/classof-raw');
var regexpExec = require('../internals/regexp-exec');
var $TypeError = TypeError;
// `RegExpExec` abstract operation
// https://tc39.es/ecma262/#sec-regexpexec
module.exports = function (R, S) {
var exec = R.exec;
if (isCallable(exec)) {
var result = call(exec, R, S);
if (result !== null) anObject(result);
return result;
}
if (classof(R) === 'RegExp') return call(regexpExec, R, S);
throw new $TypeError('RegExp#exec called on incompatible receiver');
};
object-get-prototype-of.js 0000644 00000001650 15167731775 0011617 0 ustar 00 'use strict';
var hasOwn = require('../internals/has-own-property');
var isCallable = require('../internals/is-callable');
var toObject = require('../internals/to-object');
var sharedKey = require('../internals/shared-key');
var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter');
var IE_PROTO = sharedKey('IE_PROTO');
var $Object = Object;
var ObjectPrototype = $Object.prototype;
// `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
// eslint-disable-next-line es/no-object-getprototypeof -- safe
module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
var object = toObject(O);
if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
var constructor = object.constructor;
if (isCallable(constructor) && object instanceof constructor) {
return constructor.prototype;
} return object instanceof $Object ? ObjectPrototype : null;
};
object-get-own-property-names.js 0000644 00000000756 15167731775 0012744 0 ustar 00 'use strict';
var internalObjectKeys = require('../internals/object-keys-internal');
var enumBugKeys = require('../internals/enum-bug-keys');
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
// `Object.getOwnPropertyNames` method
// https://tc39.es/ecma262/#sec-object.getownpropertynames
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return internalObjectKeys(O, hiddenKeys);
};
inspect-source.js 0000644 00000000737 15167731775 0010077 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var isCallable = require('../internals/is-callable');
var store = require('../internals/shared-store');
var functionToString = uncurryThis(Function.toString);
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
if (!isCallable(store.inspectSource)) {
store.inspectSource = function (it) {
return functionToString(it);
};
}
module.exports = store.inspectSource;
dom-token-list-prototype.js 0000644 00000000665 15167731775 0012045 0 ustar 00 'use strict';
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
var documentCreateElement = require('../internals/document-create-element');
var classList = documentCreateElement('span').classList;
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
module.exports = DOMTokenListPrototype === Object.prototype ? undefined : DOMTokenListPrototype;
object-property-is-enumerable.js 0000644 00000001202 15167731775 0012776 0 ustar 00 'use strict';
var $propertyIsEnumerable = {}.propertyIsEnumerable;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
// `Object.prototype.propertyIsEnumerable` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
async-iterator-close.js 0000644 00000001105 15167731775 0011171 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var getBuiltIn = require('../internals/get-built-in');
var getMethod = require('../internals/get-method');
module.exports = function (iterator, method, argument, reject) {
try {
var returnMethod = getMethod(iterator, 'return');
if (returnMethod) {
return getBuiltIn('Promise').resolve(call(returnMethod, iterator)).then(function () {
method(argument);
}, function (error) {
reject(error);
});
}
} catch (error2) {
return reject(error2);
} method(argument);
};
ieee754.js 0000644 00000005423 15167731775 0006300 0 ustar 00 'use strict';
// IEEE754 conversions based on https://github.com/feross/ieee754
var $Array = Array;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var pack = function (number, mantissaLength, bytes) {
var buffer = $Array(bytes);
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
var index = 0;
var exponent, mantissa, c;
number = abs(number);
// eslint-disable-next-line no-self-compare -- NaN check
if (number !== number || number === Infinity) {
// eslint-disable-next-line no-self-compare -- NaN check
mantissa = number !== number ? 1 : 0;
exponent = eMax;
} else {
exponent = floor(log(number) / LN2);
c = pow(2, -exponent);
if (number * c < 1) {
exponent--;
c *= 2;
}
if (exponent + eBias >= 1) {
number += rt / c;
} else {
number += rt * pow(2, 1 - eBias);
}
if (number * c >= 2) {
exponent++;
c /= 2;
}
if (exponent + eBias >= eMax) {
mantissa = 0;
exponent = eMax;
} else if (exponent + eBias >= 1) {
mantissa = (number * c - 1) * pow(2, mantissaLength);
exponent += eBias;
} else {
mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
exponent = 0;
}
}
while (mantissaLength >= 8) {
buffer[index++] = mantissa & 255;
mantissa /= 256;
mantissaLength -= 8;
}
exponent = exponent << mantissaLength | mantissa;
exponentLength += mantissaLength;
while (exponentLength > 0) {
buffer[index++] = exponent & 255;
exponent /= 256;
exponentLength -= 8;
}
buffer[--index] |= sign * 128;
return buffer;
};
var unpack = function (buffer, mantissaLength) {
var bytes = buffer.length;
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var nBits = exponentLength - 7;
var index = bytes - 1;
var sign = buffer[index--];
var exponent = sign & 127;
var mantissa;
sign >>= 7;
while (nBits > 0) {
exponent = exponent * 256 + buffer[index--];
nBits -= 8;
}
mantissa = exponent & (1 << -nBits) - 1;
exponent >>= -nBits;
nBits += mantissaLength;
while (nBits > 0) {
mantissa = mantissa * 256 + buffer[index--];
nBits -= 8;
}
if (exponent === 0) {
exponent = 1 - eBias;
} else if (exponent === eMax) {
return mantissa ? NaN : sign ? -Infinity : Infinity;
} else {
mantissa += pow(2, mantissaLength);
exponent -= eBias;
} return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
};
module.exports = {
pack: pack,
unpack: unpack
};
to-string-tag-support.js 0000644 00000000340 15167731775 0011333 0 ustar 00 'use strict';
var wellKnownSymbol = require('../internals/well-known-symbol');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};
test[TO_STRING_TAG] = 'z';
module.exports = String(test) === '[object z]';
get-method.js 0000644 00000000516 15167731775 0007164 0 ustar 00 'use strict';
var aCallable = require('../internals/a-callable');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
// `GetMethod` abstract operation
// https://tc39.es/ecma262/#sec-getmethod
module.exports = function (V, P) {
var func = V[P];
return isNullOrUndefined(func) ? undefined : aCallable(func);
};
engine-is-ie-or-edge.js 0000644 00000000155 15167731775 0010717 0 ustar 00 'use strict';
var UA = require('../internals/engine-user-agent');
module.exports = /MSIE|Trident/.test(UA);
create-non-enumerable-property.js 0000644 00000000704 15167731775 0013160 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var definePropertyModule = require('../internals/object-define-property');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
module.exports = DESCRIPTORS ? function (object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
define-global-property.js 0000644 00000000563 15167731775 0011503 0 ustar 00 'use strict';
var global = require('../internals/global');
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
module.exports = function (key, value) {
try {
defineProperty(global, key, { value: value, configurable: true, writable: true });
} catch (error) {
global[key] = value;
} return value;
};
microtask.js 0000644 00000005072 15167731775 0007125 0 ustar 00 'use strict';
var global = require('../internals/global');
var safeGetBuiltIn = require('../internals/safe-get-built-in');
var bind = require('../internals/function-bind-context');
var macrotask = require('../internals/task').set;
var Queue = require('../internals/queue');
var IS_IOS = require('../internals/engine-is-ios');
var IS_IOS_PEBBLE = require('../internals/engine-is-ios-pebble');
var IS_WEBOS_WEBKIT = require('../internals/engine-is-webos-webkit');
var IS_NODE = require('../internals/engine-is-node');
var MutationObserver = global.MutationObserver || global.WebKitMutationObserver;
var document = global.document;
var process = global.process;
var Promise = global.Promise;
var microtask = safeGetBuiltIn('queueMicrotask');
var notify, toggle, node, promise, then;
// modern engines have queueMicrotask method
if (!microtask) {
var queue = new Queue();
var flush = function () {
var parent, fn;
if (IS_NODE && (parent = process.domain)) parent.exit();
while (fn = queue.get()) try {
fn();
} catch (error) {
if (queue.head) notify();
throw error;
}
if (parent) parent.enter();
};
// browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
// also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver && document) {
toggle = true;
node = document.createTextNode('');
new MutationObserver(flush).observe(node, { characterData: true });
notify = function () {
node.data = toggle = !toggle;
};
// environments with maybe non-completely correct, but existent Promise
} else if (!IS_IOS_PEBBLE && Promise && Promise.resolve) {
// Promise.resolve without an argument throws an error in LG WebOS 2
promise = Promise.resolve(undefined);
// workaround of WebKit ~ iOS Safari 10.1 bug
promise.constructor = Promise;
then = bind(promise.then, promise);
notify = function () {
then(flush);
};
// Node.js without promises
} else if (IS_NODE) {
notify = function () {
process.nextTick(flush);
};
// for other environments - macrotask based on:
// - setImmediate
// - MessageChannel
// - window.postMessage
// - onreadystatechange
// - setTimeout
} else {
// `webpack` dev server bug on IE global methods - use bind(fn, global)
macrotask = bind(macrotask, global);
notify = function () {
macrotask(flush);
};
}
microtask = function (fn) {
if (!queue.head) notify();
queue.add(fn);
};
}
module.exports = microtask;
iterator-create-proxy.js 0000644 00000005721 15167731775 0011403 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var create = require('../internals/object-create');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var defineBuiltIns = require('../internals/define-built-ins');
var wellKnownSymbol = require('../internals/well-known-symbol');
var InternalStateModule = require('../internals/internal-state');
var getMethod = require('../internals/get-method');
var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype;
var createIterResultObject = require('../internals/create-iter-result-object');
var iteratorClose = require('../internals/iterator-close');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var ITERATOR_HELPER = 'IteratorHelper';
var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
var setInternalState = InternalStateModule.set;
var createIteratorProxyPrototype = function (IS_ITERATOR) {
var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
return defineBuiltIns(create(IteratorPrototype), {
next: function next() {
var state = getInternalState(this);
// for simplification:
// for `%WrapForValidIteratorPrototype%.next` our `nextHandler` returns `IterResultObject`
// for `%IteratorHelperPrototype%.next` - just a value
if (IS_ITERATOR) return state.nextHandler();
try {
var result = state.done ? undefined : state.nextHandler();
return createIterResultObject(result, state.done);
} catch (error) {
state.done = true;
throw error;
}
},
'return': function () {
var state = getInternalState(this);
var iterator = state.iterator;
state.done = true;
if (IS_ITERATOR) {
var returnMethod = getMethod(iterator, 'return');
return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
}
if (state.inner) try {
iteratorClose(state.inner.iterator, 'normal');
} catch (error) {
return iteratorClose(iterator, 'throw', error);
}
iteratorClose(iterator, 'normal');
return createIterResultObject(undefined, true);
}
});
};
var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
var IteratorHelperPrototype = createIteratorProxyPrototype(false);
createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
module.exports = function (nextHandler, IS_ITERATOR) {
var IteratorProxy = function Iterator(record, state) {
if (state) {
state.iterator = record.iterator;
state.next = record.next;
} else state = record;
state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
state.nextHandler = nextHandler;
state.counter = 0;
state.done = false;
setInternalState(this, state);
};
IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
return IteratorProxy;
};
array-group.js 0000644 00000002756 15167731775 0007407 0 ustar 00 'use strict';
var bind = require('../internals/function-bind-context');
var uncurryThis = require('../internals/function-uncurry-this');
var IndexedObject = require('../internals/indexed-object');
var toObject = require('../internals/to-object');
var toPropertyKey = require('../internals/to-property-key');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var objectCreate = require('../internals/object-create');
var arrayFromConstructorAndList = require('../internals/array-from-constructor-and-list');
var $Array = Array;
var push = uncurryThis([].push);
module.exports = function ($this, callbackfn, that, specificConstructor) {
var O = toObject($this);
var self = IndexedObject(O);
var boundFunction = bind(callbackfn, that);
var target = objectCreate(null);
var length = lengthOfArrayLike(self);
var index = 0;
var Constructor, key, value;
for (;length > index; index++) {
value = self[index];
key = toPropertyKey(boundFunction(value, index, O));
// in some IE versions, `hasOwnProperty` returns incorrect result on integer keys
// but since it's a `null` prototype object, we can safely use `in`
if (key in target) push(target[key], value);
else target[key] = [value];
}
// TODO: Remove this block from `core-js@4`
if (specificConstructor) {
Constructor = specificConstructor(O);
if (Constructor !== $Array) {
for (key in target) target[key] = arrayFromConstructorAndList(Constructor, target[key]);
}
} return target;
};
get-alphabet-option.js 0000644 00000000451 15167731775 0010770 0 ustar 00 'use strict';
var $TypeError = TypeError;
module.exports = function (options) {
var alphabet = options && options.alphabet;
if (alphabet === undefined || alphabet === 'base64' || alphabet === 'base64url') return alphabet || 'base64';
throw new $TypeError('Incorrect `alphabet` option');
};
typed-array-constructors-require-wrappers.js 0000644 00000000011 15167731775 0015437 0 ustar 00 // empty
to-object.js 0000644 00000000435 15167731775 0007015 0 ustar 00 'use strict';
var requireObjectCoercible = require('../internals/require-object-coercible');
var $Object = Object;
// `ToObject` abstract operation
// https://tc39.es/ecma262/#sec-toobject
module.exports = function (argument) {
return $Object(requireObjectCoercible(argument));
};
regexp-unsupported-dot-all.js 0000644 00000000011 15167731775 0012327 0 ustar 00 // empty
array-buffer-byte-length.js 0000644 00000000011 15167731775 0011722 0 ustar 00 // empty
detach-transferable.js 0000644 00000002151 15167731775 0011022 0 ustar 00 'use strict';
var global = require('../internals/global');
var tryNodeRequire = require('../internals/try-node-require');
var PROPER_STRUCTURED_CLONE_TRANSFER = require('../internals/structured-clone-proper-transfer');
var structuredClone = global.structuredClone;
var $ArrayBuffer = global.ArrayBuffer;
var $MessageChannel = global.MessageChannel;
var detach = false;
var WorkerThreads, channel, buffer, $detach;
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
detach = function (transferable) {
structuredClone(transferable, { transfer: [transferable] });
};
} else if ($ArrayBuffer) try {
if (!$MessageChannel) {
WorkerThreads = tryNodeRequire('worker_threads');
if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel;
}
if ($MessageChannel) {
channel = new $MessageChannel();
buffer = new $ArrayBuffer(2);
$detach = function (transferable) {
channel.port1.postMessage(null, [transferable]);
};
if (buffer.byteLength === 2) {
$detach(buffer);
if (buffer.byteLength === 0) detach = $detach;
}
}
} catch (error) { /* empty */ }
module.exports = detach;
to-length.js 0000644 00000000543 15167731775 0007030 0 ustar 00 'use strict';
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var min = Math.min;
// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
module.exports = function (argument) {
var len = toIntegerOrInfinity(argument);
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};
ordinary-to-primitive.js 0000644 00000001323 15167731775 0011401 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var $TypeError = TypeError;
// `OrdinaryToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
module.exports = function (input, pref) {
var fn, val;
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
throw new $TypeError("Can't convert object to primitive value");
};
is-iterable.js 0000644 00000001072 15167731775 0007325 0 ustar 00 'use strict';
var classof = require('../internals/classof');
var hasOwn = require('../internals/has-own-property');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var wellKnownSymbol = require('../internals/well-known-symbol');
var Iterators = require('../internals/iterators');
var ITERATOR = wellKnownSymbol('iterator');
var $Object = Object;
module.exports = function (it) {
if (isNullOrUndefined(it)) return false;
var O = $Object(it);
return O[ITERATOR] !== undefined
|| '@@iterator' in O
|| hasOwn(Iterators, classof(O));
};
get-set-record.js 0000644 00000002405 15167731775 0007752 0 ustar 00 'use strict';
var aCallable = require('../internals/a-callable');
var anObject = require('../internals/an-object');
var call = require('../internals/function-call');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var getIteratorDirect = require('../internals/get-iterator-direct');
var INVALID_SIZE = 'Invalid size';
var $RangeError = RangeError;
var $TypeError = TypeError;
var max = Math.max;
var SetRecord = function (set, intSize) {
this.set = set;
this.size = max(intSize, 0);
this.has = aCallable(set.has);
this.keys = aCallable(set.keys);
};
SetRecord.prototype = {
getIterator: function () {
return getIteratorDirect(anObject(call(this.keys, this.set)));
},
includes: function (it) {
return call(this.has, this.set, it);
}
};
// `GetSetRecord` abstract operation
// https://tc39.es/proposal-set-methods/#sec-getsetrecord
module.exports = function (obj) {
anObject(obj);
var numSize = +obj.size;
// NOTE: If size is undefined, then numSize will be NaN
// eslint-disable-next-line no-self-compare -- NaN check
if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
var intSize = toIntegerOrInfinity(numSize);
if (intSize < 0) throw new $RangeError(INVALID_SIZE);
return new SetRecord(obj, intSize);
};
engine-is-deno.js 0000644 00000000202 15167731775 0007720 0 ustar 00 'use strict';
/* global Deno -- Deno case */
module.exports = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
whitespaces.js 0000644 00000000355 15167731775 0007447 0 ustar 00 'use strict';
// a string of all valid unicode whitespaces
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';
engine-user-agent.js 0000644 00000000145 15167731775 0010442 0 ustar 00 'use strict';
module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
well-known-symbol.js 0000644 00000001427 15167731775 0010531 0 ustar 00 'use strict';
var global = require('../internals/global');
var shared = require('../internals/shared');
var hasOwn = require('../internals/has-own-property');
var uid = require('../internals/uid');
var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
var Symbol = global.Symbol;
var WellKnownSymbolsStore = shared('wks');
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
module.exports = function (name) {
if (!hasOwn(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
? Symbol[name]
: createWellKnownSymbol('Symbol.' + name);
} return WellKnownSymbolsStore[name];
};
math-expm1.js 0000644 00000001070 15167731775 0007104 0 ustar 00 'use strict';
// eslint-disable-next-line es/no-math-expm1 -- safe
var $expm1 = Math.expm1;
var exp = Math.exp;
// `Math.expm1` method implementation
// https://tc39.es/ecma262/#sec-math.expm1
module.exports = (!$expm1
// Old FF bug
// eslint-disable-next-line no-loss-of-precision -- required for old engines
|| $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
// Tor Browser bug
|| $expm1(-2e-17) !== -2e-17
) ? function expm1(x) {
var n = +x;
return n === 0 ? n : n > -1e-6 && n < 1e-6 ? n + n * n / 2 : exp(n) - 1;
} : $expm1;
array-species-constructor.js 0000644 00000001405 15167731775 0012257 0 ustar 00 'use strict';
var isArray = require('../internals/is-array');
var isConstructor = require('../internals/is-constructor');
var isObject = require('../internals/is-object');
var wellKnownSymbol = require('../internals/well-known-symbol');
var SPECIES = wellKnownSymbol('species');
var $Array = Array;
// a part of `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
module.exports = function (originalArray) {
var C;
if (isArray(originalArray)) {
C = originalArray.constructor;
// cross-realm fallback
if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
else if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return C === undefined ? $Array : C;
};
structured-clone-proper-transfer.js 0000644 00000001475 15167731775 0013565 0 ustar 00 'use strict';
var global = require('../internals/global');
var fails = require('../internals/fails');
var V8 = require('../internals/engine-v8-version');
var IS_BROWSER = require('../internals/engine-is-browser');
var IS_DENO = require('../internals/engine-is-deno');
var IS_NODE = require('../internals/engine-is-node');
var structuredClone = global.structuredClone;
module.exports = !!structuredClone && !fails(function () {
// prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
// https://github.com/zloirock/core-js/issues/679
if ((IS_DENO && V8 > 92) || (IS_NODE && V8 > 94) || (IS_BROWSER && V8 > 97)) return false;
var buffer = new ArrayBuffer(8);
var clone = structuredClone(buffer, { transfer: [buffer] });
return buffer.byteLength !== 0 || clone.byteLength !== 8;
});
set-to-string-tag.js 0000644 00000001533 15167731775 0010417 0 ustar 00 'use strict';
var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
var defineProperty = require('../internals/object-define-property').f;
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var hasOwn = require('../internals/has-own-property');
var toString = require('../internals/object-to-string');
var wellKnownSymbol = require('../internals/well-known-symbol');
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
module.exports = function (it, TAG, STATIC, SET_METHOD) {
var target = STATIC ? it : it && it.prototype;
if (target) {
if (!hasOwn(target, TO_STRING_TAG)) {
defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
}
if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
createNonEnumerableProperty(target, 'toString', toString);
}
}
};
array-buffer-transfer.js 0000644 00000000011 15167731775 0011324 0 ustar 00 // empty
iterators-core.js 0000644 00000003410 15167731775 0010065 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var create = require('../internals/object-create');
var getPrototypeOf = require('../internals/object-get-prototype-of');
var defineBuiltIn = require('../internals/define-built-in');
var wellKnownSymbol = require('../internals/well-known-symbol');
var IS_PURE = require('../internals/is-pure');
var ITERATOR = wellKnownSymbol('iterator');
var BUGGY_SAFARI_ITERATORS = false;
// `%IteratorPrototype%` object
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
/* eslint-disable es/no-array-prototype-keys -- safe */
if ([].keys) {
arrayIterator = [].keys();
// Safari 8 has buggy iterators w/o `next`
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
var test = {};
// FF44- legacy iterators case
return IteratorPrototype[ITERATOR].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
// `%IteratorPrototype%[@@iterator]()` method
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
if (!isCallable(IteratorPrototype[ITERATOR])) {
defineBuiltIn(IteratorPrototype, ITERATOR, function () {
return this;
});
}
module.exports = {
IteratorPrototype: IteratorPrototype,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
};
array-for-each.js 0000644 00000001062 15167731775 0007724 0 ustar 00 'use strict';
var $forEach = require('../internals/array-iteration').forEach;
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var STRICT_METHOD = arrayMethodIsStrict('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.foreach
module.exports = !STRICT_METHOD ? function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
// eslint-disable-next-line es/no-array-prototype-foreach -- safe
} : [].forEach;
object-get-own-property-descriptor.js 0000644 00000002162 15167731775 0014010 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var call = require('../internals/function-call');
var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
var toIndexedObject = require('../internals/to-indexed-object');
var toPropertyKey = require('../internals/to-property-key');
var hasOwn = require('../internals/has-own-property');
var IE8_DOM_DEFINE = require('../internals/ie8-dom-define');
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// `Object.getOwnPropertyDescriptor` method
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPropertyKey(P);
if (IE8_DOM_DEFINE) try {
return $getOwnPropertyDescriptor(O, P);
} catch (error) { /* empty */ }
if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
};
a-weak-map.js 0000644 00000000536 15167731775 0007051 0 ustar 00 'use strict';
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
// Perform ? RequireInternalSlot(M, [[WeakMapData]])
module.exports = function (it) {
if (typeof it == 'object' && 'has' in it && 'get' in it && 'set' in it && 'delete') return it;
throw new $TypeError(tryToString(it) + ' is not a weakmap');
};
symbol-is-well-known.js 0000644 00000003125 15167731775 0011137 0 ustar 00 'use strict';
var shared = require('../internals/shared');
var getBuiltIn = require('../internals/get-built-in');
var uncurryThis = require('../internals/function-uncurry-this');
var isSymbol = require('../internals/is-symbol');
var wellKnownSymbol = require('../internals/well-known-symbol');
var Symbol = getBuiltIn('Symbol');
var $isWellKnownSymbol = Symbol.isWellKnownSymbol;
var getOwnPropertyNames = getBuiltIn('Object', 'getOwnPropertyNames');
var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);
var WellKnownSymbolsStore = shared('wks');
for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) {
// some old engines throws on access to some keys like `arguments` or `caller`
try {
var symbolKey = symbolKeys[i];
if (isSymbol(Symbol[symbolKey])) wellKnownSymbol(symbolKey);
} catch (error) { /* empty */ }
}
// `Symbol.isWellKnownSymbol` method
// https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
// We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
module.exports = function isWellKnownSymbol(value) {
if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true;
try {
var symbol = thisSymbolValue(value);
for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {
// eslint-disable-next-line eqeqeq -- polyfilled symbols case
if (WellKnownSymbolsStore[keys[j]] == symbol) return true;
}
} catch (error) { /* empty */ }
return false;
};
caller.js 0000644 00000000357 15167731775 0006374 0 ustar 00 'use strict';
module.exports = function (methodName, numArgs) {
return numArgs === 1 ? function (object, arg) {
return object[methodName](arg);
} : function (object, arg1, arg2) {
return object[methodName](arg1, arg2);
};
};
an-object-or-undefined.js 0000644 00000000461 15167731775 0011345 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
var $String = String;
var $TypeError = TypeError;
module.exports = function (argument) {
if (argument === undefined || isObject(argument)) return argument;
throw new $TypeError($String(argument) + ' is not an object or undefined');
};
date-to-primitive.js 0000644 00000001013 15167731775 0010463 0 ustar 00 'use strict';
var anObject = require('../internals/an-object');
var ordinaryToPrimitive = require('../internals/ordinary-to-primitive');
var $TypeError = TypeError;
// `Date.prototype[@@toPrimitive](hint)` method implementation
// https://tc39.es/ecma262/#sec-date.prototype-@@toprimitive
module.exports = function (hint) {
anObject(this);
if (hint === 'string' || hint === 'default') hint = 'string';
else if (hint !== 'number') throw new $TypeError('Incorrect hint');
return ordinaryToPrimitive(this, hint);
};
flatten-into-array.js 0000644 00000002270 15167731775 0010646 0 ustar 00 'use strict';
var isArray = require('../internals/is-array');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var doesNotExceedSafeInteger = require('../internals/does-not-exceed-safe-integer');
var bind = require('../internals/function-bind-context');
// `FlattenIntoArray` abstract operation
// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
var flattenIntoArray = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
var targetIndex = start;
var sourceIndex = 0;
var mapFn = mapper ? bind(mapper, thisArg) : false;
var element, elementLen;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
if (depth > 0 && isArray(element)) {
elementLen = lengthOfArrayLike(element);
targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
} else {
doesNotExceedSafeInteger(targetIndex + 1);
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
};
module.exports = flattenIntoArray;
same-value-zero.js 0000644 00000000353 15167731775 0010142 0 ustar 00 'use strict';
// `SameValueZero` abstract operation
// https://tc39.es/ecma262/#sec-samevaluezero
module.exports = function (x, y) {
// eslint-disable-next-line no-self-compare -- NaN check
return x === y || x !== x && y !== y;
};
get-built-in.js 0000644 00000000755 15167731775 0007434 0 ustar 00 'use strict';
var path = require('../internals/path');
var global = require('../internals/global');
var isCallable = require('../internals/is-callable');
var aFunction = function (variable) {
return isCallable(variable) ? variable : undefined;
};
module.exports = function (namespace, method) {
return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace])
: path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method];
};
validate-arguments-length.js 0000644 00000000265 15167731775 0012203 0 ustar 00 'use strict';
var $TypeError = TypeError;
module.exports = function (passed, required) {
if (passed < required) throw new $TypeError('Not enough arguments');
return passed;
};
well-known-symbol-define.js 0000644 00000000726 15167731775 0011762 0 ustar 00 'use strict';
var path = require('../internals/path');
var hasOwn = require('../internals/has-own-property');
var wrappedWellKnownSymbolModule = require('../internals/well-known-symbol-wrapped');
var defineProperty = require('../internals/object-define-property').f;
module.exports = function (NAME) {
var Symbol = path.Symbol || (path.Symbol = {});
if (!hasOwn(Symbol, NAME)) defineProperty(Symbol, NAME, {
value: wrappedWellKnownSymbolModule.f(NAME)
});
};
add-to-unscopables.js 0000644 00000000074 15167731775 0010612 0 ustar 00 'use strict';
module.exports = function () { /* empty */ };
to-property-key.js 0000644 00000000515 15167731775 0010220 0 ustar 00 'use strict';
var toPrimitive = require('../internals/to-primitive');
var isSymbol = require('../internals/is-symbol');
// `ToPropertyKey` abstract operation
// https://tc39.es/ecma262/#sec-topropertykey
module.exports = function (argument) {
var key = toPrimitive(argument, 'string');
return isSymbol(key) ? key : key + '';
};
path.js 0000644 00000000043 15167731775 0006056 0 ustar 00 'use strict';
module.exports = {};
not-a-regexp.js 0000644 00000000362 15167731775 0007434 0 ustar 00 'use strict';
var isRegExp = require('../internals/is-regexp');
var $TypeError = TypeError;
module.exports = function (it) {
if (isRegExp(it)) {
throw new $TypeError("The method doesn't accept regular expressions");
} return it;
};
internal-state.js 0000644 00000004051 15167731775 0010057 0 ustar 00 'use strict';
var NATIVE_WEAK_MAP = require('../internals/weak-map-basic-detection');
var global = require('../internals/global');
var isObject = require('../internals/is-object');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var hasOwn = require('../internals/has-own-property');
var shared = require('../internals/shared-store');
var sharedKey = require('../internals/shared-key');
var hiddenKeys = require('../internals/hidden-keys');
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
var TypeError = global.TypeError;
var WeakMap = global.WeakMap;
var set, get, has;
var enforce = function (it) {
return has(it) ? get(it) : set(it, {});
};
var getterFor = function (TYPE) {
return function (it) {
var state;
if (!isObject(it) || (state = get(it)).type !== TYPE) {
throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
} return state;
};
};
if (NATIVE_WEAK_MAP || shared.state) {
var store = shared.state || (shared.state = new WeakMap());
/* eslint-disable no-self-assign -- prototype methods protection */
store.get = store.get;
store.has = store.has;
store.set = store.set;
/* eslint-enable no-self-assign -- prototype methods protection */
set = function (it, metadata) {
if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
store.set(it, metadata);
return metadata;
};
get = function (it) {
return store.get(it) || {};
};
has = function (it) {
return store.has(it);
};
} else {
var STATE = sharedKey('state');
hiddenKeys[STATE] = true;
set = function (it, metadata) {
if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get = function (it) {
return hasOwn(it, STATE) ? it[STATE] : {};
};
has = function (it) {
return hasOwn(it, STATE);
};
}
module.exports = {
set: set,
get: get,
has: has,
enforce: enforce,
getterFor: getterFor
};
engine-is-webos-webkit.js 0000644 00000000201 15167731775 0011374 0 ustar 00 'use strict';
var userAgent = require('../internals/engine-user-agent');
module.exports = /web0s(?!.*chrome)/i.test(userAgent);
collection.js 0000644 00000006171 15167731775 0007265 0 ustar 00 'use strict';
var $ = require('../internals/export');
var global = require('../internals/global');
var InternalMetadataModule = require('../internals/internal-metadata');
var fails = require('../internals/fails');
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
var iterate = require('../internals/iterate');
var anInstance = require('../internals/an-instance');
var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var setToStringTag = require('../internals/set-to-string-tag');
var defineProperty = require('../internals/object-define-property').f;
var forEach = require('../internals/array-iteration').forEach;
var DESCRIPTORS = require('../internals/descriptors');
var InternalStateModule = require('../internals/internal-state');
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
module.exports = function (CONSTRUCTOR_NAME, wrapper, common) {
var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
var ADDER = IS_MAP ? 'set' : 'add';
var NativeConstructor = global[CONSTRUCTOR_NAME];
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
var exported = {};
var Constructor;
if (!DESCRIPTORS || !isCallable(NativeConstructor)
|| !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); }))
) {
// create collection constructor
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
InternalMetadataModule.enable();
} else {
Constructor = wrapper(function (target, iterable) {
setInternalState(anInstance(target, Prototype), {
type: CONSTRUCTOR_NAME,
collection: new NativeConstructor()
});
if (!isNullOrUndefined(iterable)) iterate(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
var IS_ADDER = KEY === 'add' || KEY === 'set';
if (KEY in NativePrototype && !(IS_WEAK && KEY === 'clear')) {
createNonEnumerableProperty(Prototype, KEY, function (a, b) {
var collection = getInternalState(this).collection;
if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY === 'get' ? undefined : false;
var result = collection[KEY](a === 0 ? 0 : a, b);
return IS_ADDER ? this : result;
});
}
});
IS_WEAK || defineProperty(Prototype, 'size', {
configurable: true,
get: function () {
return getInternalState(this).collection.size;
}
});
}
setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
exported[CONSTRUCTOR_NAME] = Constructor;
$({ global: true, forced: true }, exported);
if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
return Constructor;
};
string-pad-webkit-bug.js 0000644 00000000341 15167731775 0011231 0 ustar 00 'use strict';
// https://github.com/zloirock/core-js/issues/280
var userAgent = require('../internals/engine-user-agent');
module.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent);
v8-prototype-define-bug.js 0000644 00000000713 15167731775 0011531 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var fails = require('../internals/fails');
// V8 ~ Chrome 36-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
module.exports = DESCRIPTORS && fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
value: 42,
writable: false
}).prototype !== 42;
});
function-name.js 0000644 00000001325 15167731775 0007671 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var hasOwn = require('../internals/has-own-property');
var FunctionPrototype = Function.prototype;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn(FunctionPrototype, 'name');
// additional protection from minified / mangled / dropped function names
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
module.exports = {
EXISTS: EXISTS,
PROPER: PROPER,
CONFIGURABLE: CONFIGURABLE
};
array-includes.js 0000644 00000002546 15167731775 0010056 0 ustar 00 'use strict';
var toIndexedObject = require('../internals/to-indexed-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var lengthOfArrayLike = require('../internals/length-of-array-like');
// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = lengthOfArrayLike(O);
if (length === 0) return !IS_INCLUDES && -1;
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// 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 -- NaN check
if (value !== value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) {
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
module.exports = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false)
};
is-constructor.js 0000644 00000003404 15167731775 0010124 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var fails = require('../internals/fails');
var isCallable = require('../internals/is-callable');
var classof = require('../internals/classof');
var getBuiltIn = require('../internals/get-built-in');
var inspectSource = require('../internals/inspect-source');
var noop = function () { /* empty */ };
var construct = getBuiltIn('Reflect', 'construct');
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec = uncurryThis(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable(argument)) return false;
try {
construct(noop, [], argument);
return true;
} catch (error) {
return false;
}
};
var isConstructorLegacy = function isConstructor(argument) {
if (!isCallable(argument)) return false;
switch (classof(argument)) {
case 'AsyncFunction':
case 'GeneratorFunction':
case 'AsyncGeneratorFunction': return false;
}
try {
// we can't check .prototype since constructors produced by .bind haven't it
// `Function#toString` throws on some built-it function in some legacy engines
// (for example, `DOMQuad` and similar in FF41-)
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
} catch (error) {
return true;
}
};
isConstructorLegacy.sham = true;
// `IsConstructor` abstract operation
// https://tc39.es/ecma262/#sec-isconstructor
module.exports = !construct || fails(function () {
var called;
return isConstructorModern(isConstructorModern.call)
|| !isConstructorModern(Object)
|| !isConstructorModern(function () { called = true; })
|| called;
}) ? isConstructorLegacy : isConstructorModern;
array-unique-by.js 0000644 00000002230 15167731775 0010154 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toObject = require('../internals/to-object');
var MapHelpers = require('../internals/map-helpers');
var iterate = require('../internals/map-iterate');
var Map = MapHelpers.Map;
var mapHas = MapHelpers.has;
var mapSet = MapHelpers.set;
var push = uncurryThis([].push);
// `Array.prototype.uniqueBy` method
// https://github.com/tc39/proposal-array-unique
module.exports = function uniqueBy(resolver) {
var that = toObject(this);
var length = lengthOfArrayLike(that);
var result = [];
var map = new Map();
var resolverFunction = !isNullOrUndefined(resolver) ? aCallable(resolver) : function (value) {
return value;
};
var index, item, key;
for (index = 0; index < length; index++) {
item = that[index];
key = resolverFunction(item);
if (!mapHas(map, key)) mapSet(map, key, item);
}
iterate(map, function (value) {
push(result, value);
});
return result;
};
url-constructor-detection.js 0000644 00000003147 15167731775 0012273 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var wellKnownSymbol = require('../internals/well-known-symbol');
var DESCRIPTORS = require('../internals/descriptors');
var IS_PURE = require('../internals/is-pure');
var ITERATOR = wellKnownSymbol('iterator');
module.exports = !fails(function () {
// eslint-disable-next-line unicorn/relative-url-style -- required for testing
var url = new URL('b?a=1&b=2&c=3', 'http://a');
var params = url.searchParams;
var params2 = new URLSearchParams('a=1&a=2&b=3');
var result = '';
url.pathname = 'c%20d';
params.forEach(function (value, key) {
params['delete']('b');
result += key + value;
});
params2['delete']('a', 2);
// `undefined` case is a Chromium 117 bug
// https://bugs.chromium.org/p/v8/issues/detail?id=14222
params2['delete']('b', undefined);
return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')))
|| (!params.size && (IS_PURE || !DESCRIPTORS))
|| !params.sort
|| url.href !== 'http://a/c%20d?a=1&c=3'
|| params.get('c') !== '3'
|| String(new URLSearchParams('?a=1')) !== 'a=1'
|| !params[ITERATOR]
// throws in Edge
|| new URL('https://a@b').username !== 'a'
|| new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
// not punycoded in Edge
|| new URL('http://тест').host !== 'xn--e1aybc'
// not escaped in Chrome 62-
|| new URL('http://a#б').hash !== '#%D0%B1'
// fails in Chrome 66-
|| result !== 'a1c3'
// throws in Safari
|| new URL('http://x', undefined).host !== 'x';
});
new-promise-capability.js 0000644 00000001152 15167731775 0011510 0 ustar 00 'use strict';
var aCallable = require('../internals/a-callable');
var $TypeError = TypeError;
var PromiseCapability = function (C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aCallable(resolve);
this.reject = aCallable(reject);
};
// `NewPromiseCapability` abstract operation
// https://tc39.es/ecma262/#sec-newpromisecapability
module.exports.f = function (C) {
return new PromiseCapability(C);
};
proxy-accessor.js 0000644 00000000465 15167731775 0010113 0 ustar 00 'use strict';
var defineProperty = require('../internals/object-define-property').f;
module.exports = function (Target, Source, key) {
key in Target || defineProperty(Target, key, {
configurable: true,
get: function () { return Source[key]; },
set: function (it) { Source[key] = it; }
});
};
string-trim-forced.js 0000644 00000001045 15167731775 0010644 0 ustar 00 'use strict';
var PROPER_FUNCTION_NAME = require('../internals/function-name').PROPER;
var fails = require('../internals/fails');
var whitespaces = require('../internals/whitespaces');
var non = '\u200B\u0085\u180E';
// check that a method works with the correct list
// of whitespaces and has a correct name
module.exports = function (METHOD_NAME) {
return fails(function () {
return !!whitespaces[METHOD_NAME]()
|| non[METHOD_NAME]() !== non
|| (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
});
};
iterate-simple.js 0000644 00000000575 15167731775 0010060 0 ustar 00 'use strict';
var call = require('../internals/function-call');
module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
var next = record.next;
var step, result;
while (!(step = call(next, iterator)).done) {
result = fn(step.value);
if (result !== undefined) return result;
}
};
async-iterator-indexed.js 0000644 00000000557 15167731775 0011516 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var map = require('../internals/async-iterator-map');
var callback = function (value, counter) {
return [counter, value];
};
// `AsyncIterator.prototype.indexed` method
// https://github.com/tc39/proposal-iterator-helpers
module.exports = function indexed() {
return call(map, this, callback);
};
task.js 0000644 00000006564 15167731775 0006102 0 ustar 00 'use strict';
var global = require('../internals/global');
var apply = require('../internals/function-apply');
var bind = require('../internals/function-bind-context');
var isCallable = require('../internals/is-callable');
var hasOwn = require('../internals/has-own-property');
var fails = require('../internals/fails');
var html = require('../internals/html');
var arraySlice = require('../internals/array-slice');
var createElement = require('../internals/document-create-element');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var IS_IOS = require('../internals/engine-is-ios');
var IS_NODE = require('../internals/engine-is-node');
var set = global.setImmediate;
var clear = global.clearImmediate;
var process = global.process;
var Dispatch = global.Dispatch;
var Function = global.Function;
var MessageChannel = global.MessageChannel;
var String = global.String;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = 'onreadystatechange';
var $location, defer, channel, port;
fails(function () {
// Deno throws a ReferenceError on `location` access without `--location` flag
$location = global.location;
});
var run = function (id) {
if (hasOwn(queue, id)) {
var fn = queue[id];
delete queue[id];
fn();
}
};
var runner = function (id) {
return function () {
run(id);
};
};
var eventListener = function (event) {
run(event.data);
};
var globalPostMessageDefer = function (id) {
// old engines have not location.origin
global.postMessage(String(id), $location.protocol + '//' + $location.host);
};
// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
if (!set || !clear) {
set = function setImmediate(handler) {
validateArgumentsLength(arguments.length, 1);
var fn = isCallable(handler) ? handler : Function(handler);
var args = arraySlice(arguments, 1);
queue[++counter] = function () {
apply(fn, undefined, args);
};
defer(counter);
return counter;
};
clear = function clearImmediate(id) {
delete queue[id];
};
// Node.js 0.8-
if (IS_NODE) {
defer = function (id) {
process.nextTick(runner(id));
};
// Sphere (JS game engine) Dispatch API
} else if (Dispatch && Dispatch.now) {
defer = function (id) {
Dispatch.now(runner(id));
};
// Browsers with MessageChannel, includes WebWorkers
// except iOS - https://github.com/zloirock/core-js/issues/624
} else if (MessageChannel && !IS_IOS) {
channel = new MessageChannel();
port = channel.port2;
channel.port1.onmessage = eventListener;
defer = bind(port.postMessage, port);
// Browsers with postMessage, skip WebWorkers
// IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
} else if (
global.addEventListener &&
isCallable(global.postMessage) &&
!global.importScripts &&
$location && $location.protocol !== 'file:' &&
!fails(globalPostMessageDefer)
) {
defer = globalPostMessageDefer;
global.addEventListener('message', eventListener, false);
// IE8-
} else if (ONREADYSTATECHANGE in createElement('script')) {
defer = function (id) {
html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
html.removeChild(this);
run(id);
};
};
// Rest old browsers
} else {
defer = function (id) {
setTimeout(runner(id), 0);
};
}
}
module.exports = {
set: set,
clear: clear
};
to-set-like.js 0000644 00000001072 15167731775 0007262 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var isCallable = require('../internals/is-callable');
var isIterable = require('../internals/is-iterable');
var isObject = require('../internals/is-object');
var Set = getBuiltIn('Set');
var isSetLike = function (it) {
return isObject(it)
&& typeof it.size == 'number'
&& isCallable(it.has)
&& isCallable(it.keys);
};
// fallback old -> new set methods proposal arguments
module.exports = function (it) {
if (isSetLike(it)) return it;
return isIterable(it) ? new Set(it) : it;
};
object-get-own-property-names-external.js 0000644 00000001540 15167731775 0014554 0 ustar 00 'use strict';
/* eslint-disable es/no-object-getownpropertynames -- safe */
var classof = require('../internals/classof-raw');
var toIndexedObject = require('../internals/to-indexed-object');
var $getOwnPropertyNames = require('../internals/object-get-own-property-names').f;
var arraySlice = require('../internals/array-slice');
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return $getOwnPropertyNames(it);
} catch (error) {
return arraySlice(windowNames);
}
};
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
module.exports.f = function getOwnPropertyNames(it) {
return windowNames && classof(it) === 'Window'
? getWindowNames(it)
: $getOwnPropertyNames(toIndexedObject(it));
};
array-last-index-of.js 0000644 00000002444 15167731775 0010717 0 ustar 00 'use strict';
/* eslint-disable es/no-array-prototype-lastindexof -- safe */
var apply = require('../internals/function-apply');
var toIndexedObject = require('../internals/to-indexed-object');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var arrayMethodIsStrict = require('../internals/array-method-is-strict');
var min = Math.min;
var $lastIndexOf = [].lastIndexOf;
var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict('lastIndexOf');
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
// `Array.prototype.lastIndexOf` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.lastindexof
module.exports = FORCED ? function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
// convert -0 to +0
if (NEGATIVE_ZERO) return apply($lastIndexOf, this, arguments) || 0;
var O = toIndexedObject(this);
var length = lengthOfArrayLike(O);
if (length === 0) return -1;
var index = length - 1;
if (arguments.length > 1) index = min(index, toIntegerOrInfinity(arguments[1]));
if (index < 0) index = length + index;
for (;index >= 0; index--) if (index in O && O[index] === searchElement) return index || 0;
return -1;
} : $lastIndexOf;
html.js 0000644 00000000202 15167731775 0006063 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
module.exports = getBuiltIn('document', 'documentElement');
array-buffer-basic-detection.js 0000644 00000000233 15167731775 0012543 0 ustar 00 'use strict';
// eslint-disable-next-line es/no-typed-arrays -- safe
module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
is-data-descriptor.js 0000644 00000000330 15167731775 0010617 0 ustar 00 'use strict';
var hasOwn = require('../internals/has-own-property');
module.exports = function (descriptor) {
return descriptor !== undefined && (hasOwn(descriptor, 'value') || hasOwn(descriptor, 'writable'));
};
array-with.js 0000644 00000001366 15167731775 0007222 0 ustar 00 'use strict';
var lengthOfArrayLike = require('../internals/length-of-array-like');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var $RangeError = RangeError;
// https://tc39.es/proposal-change-array-by-copy/#sec-array.prototype.with
// https://tc39.es/proposal-change-array-by-copy/#sec-%typedarray%.prototype.with
module.exports = function (O, C, index, value) {
var len = lengthOfArrayLike(O);
var relativeIndex = toIntegerOrInfinity(index);
var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;
if (actualIndex >= len || actualIndex < 0) throw new $RangeError('Incorrect index');
var A = new C(len);
var k = 0;
for (; k < len; k++) A[k] = k === actualIndex ? value : O[k];
return A;
};
entry-virtual.js 0000644 00000000217 15167731775 0007752 0 ustar 00 'use strict';
var path = require('../internals/path');
module.exports = function (CONSTRUCTOR) {
return path[CONSTRUCTOR + 'Prototype'];
};
is-raw-json.js 0000644 00000000443 15167731775 0007277 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
var getInternalState = require('../internals/internal-state').get;
module.exports = function isRawJSON(O) {
if (!isObject(O)) return false;
var state = getInternalState(O);
return !!state && state.type === 'RawJSON';
};
symbol-is-registered.js 0000644 00000001070 15167731775 0011174 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var uncurryThis = require('../internals/function-uncurry-this');
var Symbol = getBuiltIn('Symbol');
var keyFor = Symbol.keyFor;
var thisSymbolValue = uncurryThis(Symbol.prototype.valueOf);
// `Symbol.isRegisteredSymbol` method
// https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
module.exports = Symbol.isRegisteredSymbol || function isRegisteredSymbol(value) {
try {
return keyFor(thisSymbolValue(value)) !== undefined;
} catch (error) {
return false;
}
};
to-big-int.js 0000644 00000000647 15167731775 0007105 0 ustar 00 'use strict';
var toPrimitive = require('../internals/to-primitive');
var $TypeError = TypeError;
// `ToBigInt` abstract operation
// https://tc39.es/ecma262/#sec-tobigint
module.exports = function (argument) {
var prim = toPrimitive(argument, 'number');
if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
// eslint-disable-next-line es/no-bigint -- safe
return BigInt(prim);
};
string-pad.js 0000644 00000002674 15167731775 0007206 0 ustar 00 'use strict';
// https://github.com/tc39/proposal-string-pad-start-end
var uncurryThis = require('../internals/function-uncurry-this');
var toLength = require('../internals/to-length');
var toString = require('../internals/to-string');
var $repeat = require('../internals/string-repeat');
var requireObjectCoercible = require('../internals/require-object-coercible');
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis(''.slice);
var ceil = Math.ceil;
// `String.prototype.{ padStart, padEnd }` methods implementation
var createMethod = function (IS_END) {
return function ($this, maxLength, fillString) {
var S = toString(requireObjectCoercible($this));
var intMaxLength = toLength(maxLength);
var stringLength = S.length;
var fillStr = fillString === undefined ? ' ' : toString(fillString);
var fillLen, stringFiller;
if (intMaxLength <= stringLength || fillStr === '') return S;
fillLen = intMaxLength - stringLength;
stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen);
return IS_END ? S + stringFiller : stringFiller + S;
};
};
module.exports = {
// `String.prototype.padStart` method
// https://tc39.es/ecma262/#sec-string.prototype.padstart
start: createMethod(false),
// `String.prototype.padEnd` method
// https://tc39.es/ecma262/#sec-string.prototype.padend
end: createMethod(true)
};
set-symmetric-difference.js 0000644 00000001344 15167731775 0012024 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var SetHelpers = require('../internals/set-helpers');
var clone = require('../internals/set-clone');
var getSetRecord = require('../internals/get-set-record');
var iterateSimple = require('../internals/iterate-simple');
var add = SetHelpers.add;
var has = SetHelpers.has;
var remove = SetHelpers.remove;
// `Set.prototype.symmetricDifference` method
// https://github.com/tc39/proposal-set-methods
module.exports = function symmetricDifference(other) {
var O = aSet(this);
var keysIter = getSetRecord(other).getIterator();
var result = clone(O);
iterateSimple(keysIter, function (e) {
if (has(O, e)) remove(result, e);
else add(result, e);
});
return result;
};
array-group-to-map.js 0000644 00000002156 15167731775 0010574 0 ustar 00 'use strict';
var bind = require('../internals/function-bind-context');
var uncurryThis = require('../internals/function-uncurry-this');
var IndexedObject = require('../internals/indexed-object');
var toObject = require('../internals/to-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var MapHelpers = require('../internals/map-helpers');
var Map = MapHelpers.Map;
var mapGet = MapHelpers.get;
var mapHas = MapHelpers.has;
var mapSet = MapHelpers.set;
var push = uncurryThis([].push);
// `Array.prototype.groupToMap` method
// https://github.com/tc39/proposal-array-grouping
module.exports = function groupToMap(callbackfn /* , thisArg */) {
var O = toObject(this);
var self = IndexedObject(O);
var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
var map = new Map();
var length = lengthOfArrayLike(self);
var index = 0;
var key, value;
for (;length > index; index++) {
value = self[index];
key = boundFunction(value, index, O);
if (mapHas(map, key)) push(mapGet(map, key), value);
else mapSet(map, key, [value]);
} return map;
};
error-stack-clear.js 0000644 00000001174 15167731775 0010450 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var $Error = Error;
var replace = uncurryThis(''.replace);
var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
// eslint-disable-next-line redos/no-vulnerable -- safe
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
module.exports = function (stack, dropEntries) {
if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
} return stack;
};
README.md 0000644 00000000077 15167731775 0006052 0 ustar 00 This folder contains internal parts of `core-js` like helpers.
object-is-prototype-of.js 0000644 00000000200 15167731775 0011441 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
module.exports = uncurryThis({}.isPrototypeOf);
get-iterator-direct.js 0000644 00000000355 15167731775 0011006 0 ustar 00 'use strict';
// `GetIteratorDirect(obj)` abstract operation
// https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
module.exports = function (obj) {
return {
iterator: obj,
next: obj.next,
done: false
};
};
define-built-in.js 0000644 00000000451 15167731775 0010100 0 ustar 00 'use strict';
var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
module.exports = function (target, key, value, options) {
if (options && options.enumerable) target[key] = value;
else createNonEnumerableProperty(target, key, value);
return target;
};
function-call.js 0000644 00000000334 15167731775 0007663 0 ustar 00 'use strict';
var NATIVE_BIND = require('../internals/function-bind-native');
var call = Function.prototype.call;
module.exports = NATIVE_BIND ? call.bind(call) : function () {
return call.apply(call, arguments);
};
math-scale.js 0000644 00000001155 15167731775 0007145 0 ustar 00 'use strict';
// `Math.scale` method implementation
// https://rwaldron.github.io/proposal-math-extensions/
module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
var nx = +x;
var nInLow = +inLow;
var nInHigh = +inHigh;
var nOutLow = +outLow;
var nOutHigh = +outHigh;
// eslint-disable-next-line no-self-compare -- NaN check
if (nx !== nx || nInLow !== nInLow || nInHigh !== nInHigh || nOutLow !== nOutLow || nOutHigh !== nOutHigh) return NaN;
if (nx === Infinity || nx === -Infinity) return nx;
return (nx - nInLow) * (nOutHigh - nOutLow) / (nInHigh - nInLow) + nOutLow;
};
schedulers-fix.js 0000644 00000002747 15167731775 0010064 0 ustar 00 'use strict';
var global = require('../internals/global');
var apply = require('../internals/function-apply');
var isCallable = require('../internals/is-callable');
var ENGINE_IS_BUN = require('../internals/engine-is-bun');
var USER_AGENT = require('../internals/engine-user-agent');
var arraySlice = require('../internals/array-slice');
var validateArgumentsLength = require('../internals/validate-arguments-length');
var Function = global.Function;
// dirty IE9- and Bun 0.3.0- checks
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
var version = global.Bun.version.split('.');
return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
})();
// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
// https://github.com/oven-sh/bun/issues/1633
module.exports = function (scheduler, hasTimeArg) {
var firstParamIndex = hasTimeArg ? 2 : 1;
return WRAP ? function (handler, timeout /* , ...arguments */) {
var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
var fn = isCallable(handler) ? handler : Function(handler);
var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
var callback = boundArgs ? function () {
apply(fn, this, params);
} : fn;
return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
} : scheduler;
};
document-create-element.js 0000644 00000000542 15167731775 0011634 0 ustar 00 'use strict';
var global = require('../internals/global');
var isObject = require('../internals/is-object');
var document = global.document;
// typeof document.createElement is 'object' in old IE
var EXISTS = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return EXISTS ? document.createElement(it) : {};
};
parse-json-string.js 0000644 00000003220 15167731775 0010507 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var hasOwn = require('../internals/has-own-property');
var $SyntaxError = SyntaxError;
var $parseInt = parseInt;
var fromCharCode = String.fromCharCode;
var at = uncurryThis(''.charAt);
var slice = uncurryThis(''.slice);
var exec = uncurryThis(/./.exec);
var codePoints = {
'\\"': '"',
'\\\\': '\\',
'\\/': '/',
'\\b': '\b',
'\\f': '\f',
'\\n': '\n',
'\\r': '\r',
'\\t': '\t'
};
var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i;
// eslint-disable-next-line regexp/no-control-character -- safe
var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/;
module.exports = function (source, i) {
var unterminated = true;
var value = '';
while (i < source.length) {
var chr = at(source, i);
if (chr === '\\') {
var twoChars = slice(source, i, i + 2);
if (hasOwn(codePoints, twoChars)) {
value += codePoints[twoChars];
i += 2;
} else if (twoChars === '\\u') {
i += 2;
var fourHexDigits = slice(source, i, i + 4);
if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
value += fromCharCode($parseInt(fourHexDigits, 16));
i += 4;
} else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
} else if (chr === '"') {
unterminated = false;
i++;
break;
} else {
if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);
value += chr;
i++;
}
}
if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);
return { value: value, end: i };
};
array-buffer.js 0000644 00000000011 15167731775 0007502 0 ustar 00 // empty
create-iter-result-object.js 0000644 00000000310 15167731775 0012103 0 ustar 00 'use strict';
// `CreateIterResultObject` abstract operation
// https://tc39.es/ecma262/#sec-createiterresultobject
module.exports = function (value, done) {
return { value: value, done: done };
};
call-with-safe-iteration-closing.js 0000644 00000000611 15167731775 0013353 0 ustar 00 'use strict';
var anObject = require('../internals/an-object');
var iteratorClose = require('../internals/iterator-close');
// call something on iterator step with safe closing on error
module.exports = function (iterator, fn, value, ENTRIES) {
try {
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
};
array-copy-within.js 0000644 00000002173 15167731775 0010516 0 ustar 00 'use strict';
var toObject = require('../internals/to-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var deletePropertyOrThrow = require('../internals/delete-property-or-throw');
var min = Math.min;
// `Array.prototype.copyWithin` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.copywithin
// eslint-disable-next-line es/no-array-prototype-copywithin -- safe
module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
var O = toObject(this);
var len = lengthOfArrayLike(O);
var to = toAbsoluteIndex(target, len);
var from = toAbsoluteIndex(start, len);
var end = arguments.length > 2 ? arguments[2] : undefined;
var count = min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O) O[to] = O[from];
else deletePropertyOrThrow(O, to);
to += inc;
from += inc;
} return O;
};
array-buffer-is-detached.js 0000644 00000000011 15167731775 0011652 0 ustar 00 // empty
function-apply.js 0000644 00000000621 15167731775 0010074 0 ustar 00 'use strict';
var NATIVE_BIND = require('../internals/function-bind-native');
var FunctionPrototype = Function.prototype;
var apply = FunctionPrototype.apply;
var call = FunctionPrototype.call;
// eslint-disable-next-line es/no-reflect -- safe
module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
return call.apply(apply, arguments);
});
object-prototype-accessors-forced.js 0000644 00000001341 15167731775 0013660 0 ustar 00 'use strict';
var IS_PURE = require('../internals/is-pure');
var global = require('../internals/global');
var fails = require('../internals/fails');
var WEBKIT = require('../internals/engine-webkit-version');
// Forced replacement object prototype accessors methods
module.exports = IS_PURE || !fails(function () {
// This feature detection crashes old WebKit
// https://github.com/zloirock/core-js/issues/232
if (WEBKIT && WEBKIT < 535) return;
var key = Math.random();
// In FF throws only define methods
// eslint-disable-next-line no-undef, no-useless-call, es/no-legacy-object-prototype-accessor-methods -- required for testing
__defineSetter__.call(null, key, function () { /* empty */ });
delete global[key];
});
add-disposable-resource.js 0000644 00000004160 15167731775 0011626 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var uncurryThis = require('../internals/function-uncurry-this');
var bind = require('../internals/function-bind-context');
var anObject = require('../internals/an-object');
var aCallable = require('../internals/a-callable');
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var getMethod = require('../internals/get-method');
var wellKnownSymbol = require('../internals/well-known-symbol');
var ASYNC_DISPOSE = wellKnownSymbol('asyncDispose');
var DISPOSE = wellKnownSymbol('dispose');
var push = uncurryThis([].push);
// `GetDisposeMethod` abstract operation
// https://tc39.es/proposal-explicit-resource-management/#sec-getdisposemethod
var getDisposeMethod = function (V, hint) {
if (hint === 'async-dispose') {
var method = getMethod(V, ASYNC_DISPOSE);
if (method !== undefined) return method;
method = getMethod(V, DISPOSE);
if (method === undefined) return method;
return function () {
call(method, this);
};
} return getMethod(V, DISPOSE);
};
// `CreateDisposableResource` abstract operation
// https://tc39.es/proposal-explicit-resource-management/#sec-createdisposableresource
var createDisposableResource = function (V, hint, method) {
if (arguments.length < 3 && !isNullOrUndefined(V)) {
method = aCallable(getDisposeMethod(anObject(V), hint));
}
return method === undefined ? function () {
return undefined;
} : bind(method, V);
};
// `AddDisposableResource` abstract operation
// https://tc39.es/proposal-explicit-resource-management/#sec-adddisposableresource
module.exports = function (disposable, V, hint, method) {
var resource;
if (arguments.length < 4) {
// When `V`` is either `null` or `undefined` and hint is `async-dispose`,
// we record that the resource was evaluated to ensure we will still perform an `Await` when resources are later disposed.
if (isNullOrUndefined(V) && hint === 'sync-dispose') return;
resource = createDisposableResource(V, hint);
} else {
resource = createDisposableResource(undefined, hint, method);
}
push(disposable.stack, resource);
};
string-trim.js 0000644 00000002261 15167731775 0007405 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var requireObjectCoercible = require('../internals/require-object-coercible');
var toString = require('../internals/to-string');
var whitespaces = require('../internals/whitespaces');
var replace = uncurryThis(''.replace);
var ltrim = RegExp('^[' + whitespaces + ']+');
var rtrim = RegExp('(^|[^' + whitespaces + '])[' + whitespaces + ']+$');
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
var createMethod = function (TYPE) {
return function ($this) {
var string = toString(requireObjectCoercible($this));
if (TYPE & 1) string = replace(string, ltrim, '');
if (TYPE & 2) string = replace(string, rtrim, '$1');
return string;
};
};
module.exports = {
// `String.prototype.{ trimLeft, trimStart }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
start: createMethod(1),
// `String.prototype.{ trimRight, trimEnd }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimend
end: createMethod(2),
// `String.prototype.trim` method
// https://tc39.es/ecma262/#sec-string.prototype.trim
trim: createMethod(3)
};
set-helpers.js 0000644 00000000474 15167731775 0007365 0 ustar 00 'use strict';
var getBuiltIn = require('../internals/get-built-in');
var caller = require('../internals/caller');
var Set = getBuiltIn('Set');
var SetPrototype = Set.prototype;
module.exports = {
Set: Set,
add: caller('add', 1),
has: caller('has', 1),
remove: caller('delete', 1),
proto: SetPrototype
};
function-bind.js 0000644 00000002660 15167731775 0007670 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var aCallable = require('../internals/a-callable');
var isObject = require('../internals/is-object');
var hasOwn = require('../internals/has-own-property');
var arraySlice = require('../internals/array-slice');
var NATIVE_BIND = require('../internals/function-bind-native');
var $Function = Function;
var concat = uncurryThis([].concat);
var join = uncurryThis([].join);
var factories = {};
var construct = function (C, argsLength, args) {
if (!hasOwn(factories, argsLength)) {
var list = [];
var i = 0;
for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
} return factories[argsLength](C, args);
};
// `Function.prototype.bind` method implementation
// https://tc39.es/ecma262/#sec-function.prototype.bind
// eslint-disable-next-line es/no-function-prototype-bind -- detection
module.exports = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
var F = aCallable(this);
var Prototype = F.prototype;
var partArgs = arraySlice(arguments, 1);
var boundFunction = function bound(/* args... */) {
var args = concat(partArgs, arraySlice(arguments));
return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
};
if (isObject(Prototype)) boundFunction.prototype = Prototype;
return boundFunction;
};
is-pure.js 0000644 00000000045 15167731775 0006510 0 ustar 00 'use strict';
module.exports = true;
dom-iterables.js 0000644 00000001377 15167731775 0007664 0 ustar 00 'use strict';
// iterable DOM collections
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
module.exports = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
shared-store.js 0000644 00000001124 15167731775 0007523 0 ustar 00 'use strict';
var IS_PURE = require('../internals/is-pure');
var globalThis = require('../internals/global');
var defineGlobalProperty = require('../internals/define-global-property');
var SHARED = '__core-js_shared__';
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: '3.37.1',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.37.1/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
reflect-metadata.js 0000644 00000004057 15167731775 0010335 0 ustar 00 'use strict';
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
require('../modules/es.map');
require('../modules/es.weak-map');
var getBuiltIn = require('../internals/get-built-in');
var uncurryThis = require('../internals/function-uncurry-this');
var shared = require('../internals/shared');
var Map = getBuiltIn('Map');
var WeakMap = getBuiltIn('WeakMap');
var push = uncurryThis([].push);
var metadata = shared('metadata');
var store = metadata.store || (metadata.store = new WeakMap());
var getOrCreateMetadataMap = function (target, targetKey, create) {
var targetMetadata = store.get(target);
if (!targetMetadata) {
if (!create) return;
store.set(target, targetMetadata = new Map());
}
var keyMetadata = targetMetadata.get(targetKey);
if (!keyMetadata) {
if (!create) return;
targetMetadata.set(targetKey, keyMetadata = new Map());
} return keyMetadata;
};
var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
};
var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
var metadataMap = getOrCreateMetadataMap(O, P, false);
return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
};
var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
};
var ordinaryOwnMetadataKeys = function (target, targetKey) {
var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
var keys = [];
if (metadataMap) metadataMap.forEach(function (_, key) { push(keys, key); });
return keys;
};
var toMetadataKey = function (it) {
return it === undefined || typeof it == 'symbol' ? it : String(it);
};
module.exports = {
store: store,
getMap: getOrCreateMetadataMap,
has: ordinaryHasOwnMetadata,
get: ordinaryGetOwnMetadata,
set: ordinaryDefineOwnMetadata,
keys: ordinaryOwnMetadataKeys,
toKey: toMetadataKey
};
set-union.js 0000644 00000001107 15167731775 0007045 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var add = require('../internals/set-helpers').add;
var clone = require('../internals/set-clone');
var getSetRecord = require('../internals/get-set-record');
var iterateSimple = require('../internals/iterate-simple');
// `Set.prototype.union` method
// https://github.com/tc39/proposal-set-methods
module.exports = function union(other) {
var O = aSet(this);
var keysIter = getSetRecord(other).getIterator();
var result = clone(O);
iterateSimple(keysIter, function (it) {
add(result, it);
});
return result;
};
map-iterate.js 0000644 00000000415 15167731775 0007335 0 ustar 00 'use strict';
var iterateSimple = require('../internals/iterate-simple');
module.exports = function (map, fn, interruptible) {
return interruptible ? iterateSimple(map.entries(), function (entry) {
return fn(entry[1], entry[0]);
}, true) : map.forEach(fn);
};
object-define-properties.js 0000644 00000001635 15167731775 0012022 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var V8_PROTOTYPE_DEFINE_BUG = require('../internals/v8-prototype-define-bug');
var definePropertyModule = require('../internals/object-define-property');
var anObject = require('../internals/an-object');
var toIndexedObject = require('../internals/to-indexed-object');
var objectKeys = require('../internals/object-keys');
// `Object.defineProperties` method
// https://tc39.es/ecma262/#sec-object.defineproperties
// eslint-disable-next-line es/no-object-defineproperties -- safe
exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var props = toIndexedObject(Properties);
var keys = objectKeys(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
return O;
};
a-constructor.js 0000644 00000000561 15167731775 0007732 0 ustar 00 'use strict';
var isConstructor = require('../internals/is-constructor');
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
// `Assert: IsConstructor(argument) is true`
module.exports = function (argument) {
if (isConstructor(argument)) return argument;
throw new $TypeError(tryToString(argument) + ' is not a constructor');
};
collection-of.js 0000644 00000000712 15167731775 0007662 0 ustar 00 'use strict';
var anObject = require('../internals/an-object');
// https://tc39.github.io/proposal-setmap-offrom/
module.exports = function (C, adder, ENTRY) {
return function of() {
var result = new C();
var length = arguments.length;
for (var index = 0; index < length; index++) {
var entry = arguments[index];
if (ENTRY) adder(result, anObject(entry)[0], entry[1]);
else adder(result, entry);
} return result;
};
};
error-stack-installable.js 0000644 00000000644 15167731775 0011655 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var createPropertyDescriptor = require('../internals/create-property-descriptor');
module.exports = !fails(function () {
var error = new Error('a');
if (!('stack' in error)) return true;
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
return error.stack !== 7;
});
array-buffer-non-extensible.js 0000644 00000000706 15167731775 0012445 0 ustar 00 'use strict';
// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
var fails = require('../internals/fails');
module.exports = fails(function () {
if (typeof ArrayBuffer == 'function') {
var buffer = new ArrayBuffer(8);
// eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
}
});
regexp-unsupported-ncg.js 0000644 00000000622 15167731775 0011552 0 ustar 00 'use strict';
var fails = require('../internals/fails');
var global = require('../internals/global');
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
var $RegExp = global.RegExp;
module.exports = fails(function () {
var re = $RegExp('(?<a>b)', 'g');
return re.exec('b').groups.a !== 'b' ||
'b'.replace(re, '$<a>c') !== 'bc';
});
set-is-superset-of.js 0000644 00000001410 15167731775 0010577 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var has = require('../internals/set-helpers').has;
var size = require('../internals/set-size');
var getSetRecord = require('../internals/get-set-record');
var iterateSimple = require('../internals/iterate-simple');
var iteratorClose = require('../internals/iterator-close');
// `Set.prototype.isSupersetOf` method
// https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
module.exports = function isSupersetOf(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
if (size(O) < otherRec.size) return false;
var iterator = otherRec.getIterator();
return iterateSimple(iterator, function (e) {
if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
}) !== false;
};
error-to-string.js 0000644 00000002256 15167731775 0010207 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var fails = require('../internals/fails');
var anObject = require('../internals/an-object');
var normalizeStringArgument = require('../internals/normalize-string-argument');
var nativeErrorToString = Error.prototype.toString;
var INCORRECT_TO_STRING = fails(function () {
if (DESCRIPTORS) {
// Chrome 32- incorrectly call accessor
// eslint-disable-next-line es/no-object-create, es/no-object-defineproperty -- safe
var object = Object.create(Object.defineProperty({}, 'name', { get: function () {
return this === object;
} }));
if (nativeErrorToString.call(object) !== 'true') return true;
}
// FF10- does not properly handle non-strings
return nativeErrorToString.call({ message: 1, name: 2 }) !== '2: 1'
// IE8 does not properly handle defaults
|| nativeErrorToString.call({}) !== 'Error';
});
module.exports = INCORRECT_TO_STRING ? function toString() {
var O = anObject(this);
var name = normalizeStringArgument(O.name, 'Error');
var message = normalizeStringArgument(O.message);
return !name ? message : !message ? name : name + ': ' + message;
} : nativeErrorToString;
engine-is-ios.js 0000644 00000000311 15167731775 0007566 0 ustar 00 'use strict';
var userAgent = require('../internals/engine-user-agent');
// eslint-disable-next-line redos/no-vulnerable -- safe
module.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent);
promise-resolve.js 0000644 00000000671 15167731775 0010264 0 ustar 00 'use strict';
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var newPromiseCapability = require('../internals/new-promise-capability');
module.exports = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
internal-metadata.js 0000644 00000005424 15167731775 0010524 0 ustar 00 'use strict';
var $ = require('../internals/export');
var uncurryThis = require('../internals/function-uncurry-this');
var hiddenKeys = require('../internals/hidden-keys');
var isObject = require('../internals/is-object');
var hasOwn = require('../internals/has-own-property');
var defineProperty = require('../internals/object-define-property').f;
var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names');
var getOwnPropertyNamesExternalModule = require('../internals/object-get-own-property-names-external');
var isExtensible = require('../internals/object-is-extensible');
var uid = require('../internals/uid');
var FREEZING = require('../internals/freezing');
var REQUIRED = false;
var METADATA = uid('meta');
var id = 0;
var setMetadata = function (it) {
defineProperty(it, METADATA, { value: {
objectID: 'O' + id++, // object ID
weakData: {} // weak collections IDs
} });
};
var fastKey = function (it, create) {
// return a primitive with prefix
if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!hasOwn(it, METADATA)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return 'F';
// not necessary to add metadata
if (!create) return 'E';
// add missing metadata
setMetadata(it);
// return object ID
} return it[METADATA].objectID;
};
var getWeakData = function (it, create) {
if (!hasOwn(it, METADATA)) {
// can't set metadata to uncaught frozen object
if (!isExtensible(it)) return true;
// not necessary to add metadata
if (!create) return false;
// add missing metadata
setMetadata(it);
// return the store of weak collections IDs
} return it[METADATA].weakData;
};
// add metadata on freeze-family methods calling
var onFreeze = function (it) {
if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it);
return it;
};
var enable = function () {
meta.enable = function () { /* empty */ };
REQUIRED = true;
var getOwnPropertyNames = getOwnPropertyNamesModule.f;
var splice = uncurryThis([].splice);
var test = {};
test[METADATA] = 1;
// prevent exposing of metadata key
if (getOwnPropertyNames(test).length) {
getOwnPropertyNamesModule.f = function (it) {
var result = getOwnPropertyNames(it);
for (var i = 0, length = result.length; i < length; i++) {
if (result[i] === METADATA) {
splice(result, i, 1);
break;
}
} return result;
};
$({ target: 'Object', stat: true, forced: true }, {
getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
});
}
};
var meta = module.exports = {
enable: enable,
fastKey: fastKey,
getWeakData: getWeakData,
onFreeze: onFreeze
};
hiddenKeys[METADATA] = true;
to-string.js 0000644 00000000403 15167731775 0007050 0 ustar 00 'use strict';
var classof = require('../internals/classof');
var $String = String;
module.exports = function (argument) {
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
return $String(argument);
};
fails.js 0000644 00000000172 15167731775 0006223 0 ustar 00 'use strict';
module.exports = function (exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
array-from-constructor-and-list.js 0000644 00000000534 15167731775 0013302 0 ustar 00 'use strict';
var lengthOfArrayLike = require('../internals/length-of-array-like');
module.exports = function (Constructor, list, $length) {
var index = 0;
var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
var result = new Constructor(length);
while (length > index) result[index] = list[index++];
return result;
};
math-log1p.js 0000644 00000000452 15167731775 0007077 0 ustar 00 'use strict';
var log = Math.log;
// `Math.log1p` method implementation
// https://tc39.es/ecma262/#sec-math.log1p
// eslint-disable-next-line es/no-math-log1p -- safe
module.exports = Math.log1p || function log1p(x) {
var n = +x;
return n > -1e-8 && n < 1e-8 ? n - n * n / 2 : log(1 + n);
};
a-set.js 0000644 00000000555 15167731775 0006143 0 ustar 00 'use strict';
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
// Perform ? RequireInternalSlot(M, [[SetData]])
module.exports = function (it) {
if (typeof it == 'object' && 'size' in it && 'has' in it && 'add' in it && 'delete' in it && 'keys' in it) return it;
throw new $TypeError(tryToString(it) + ' is not a set');
};
hidden-keys.js 0000644 00000000043 15167731775 0007326 0 ustar 00 'use strict';
module.exports = {};
symbol-registry-detection.js 0000644 00000000311 15167731775 0012247 0 ustar 00 'use strict';
var NATIVE_SYMBOL = require('../internals/symbol-constructor-detection');
/* eslint-disable es/no-symbol -- safe */
module.exports = NATIVE_SYMBOL && !!Symbol['for'] && !!Symbol.keyFor;
object-assign.js 0000644 00000004514 15167731775 0007661 0 ustar 00 'use strict';
var DESCRIPTORS = require('../internals/descriptors');
var uncurryThis = require('../internals/function-uncurry-this');
var call = require('../internals/function-call');
var fails = require('../internals/fails');
var objectKeys = require('../internals/object-keys');
var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
var toObject = require('../internals/to-object');
var IndexedObject = require('../internals/indexed-object');
// eslint-disable-next-line es/no-object-assign -- safe
var $assign = Object.assign;
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
var defineProperty = Object.defineProperty;
var concat = uncurryThis([].concat);
// `Object.assign` method
// https://tc39.es/ecma262/#sec-object.assign
module.exports = !$assign || fails(function () {
// should have correct order of operations (Edge bug)
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
enumerable: true,
get: function () {
defineProperty(this, 'b', {
value: 3,
enumerable: false
});
}
}), { b: 2 })).b !== 1) return true;
// should work with symbols and should have deterministic property order (V8 bug)
var A = {};
var B = {};
// eslint-disable-next-line es/no-symbol -- safe
var symbol = Symbol('assign detection');
var alphabet = 'abcdefghijklmnopqrst';
A[symbol] = 7;
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
var T = toObject(target);
var argumentsLength = arguments.length;
var index = 1;
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
var propertyIsEnumerable = propertyIsEnumerableModule.f;
while (argumentsLength > index) {
var S = IndexedObject(arguments[index++]);
var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
}
} return T;
} : $assign;
math-f16round.js 0000644 00000000634 15167731775 0007523 0 ustar 00 'use strict';
var floatRound = require('../internals/math-float-round');
var FLOAT16_EPSILON = 0.0009765625;
var FLOAT16_MAX_VALUE = 65504;
var FLOAT16_MIN_VALUE = 6.103515625e-05;
// `Math.f16round` method implementation
// https://github.com/tc39/proposal-float16array
module.exports = Math.f16round || function f16round(x) {
return floatRound(x, FLOAT16_EPSILON, FLOAT16_MAX_VALUE, FLOAT16_MIN_VALUE);
};
create-html.js 0000644 00000001162 15167731775 0007332 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var requireObjectCoercible = require('../internals/require-object-coercible');
var toString = require('../internals/to-string');
var quot = /"/g;
var replace = uncurryThis(''.replace);
// `CreateHTML` abstract operation
// https://tc39.es/ecma262/#sec-createhtml
module.exports = function (string, tag, attribute, value) {
var S = toString(requireObjectCoercible(string));
var p1 = '<' + tag;
if (attribute !== '') p1 += ' ' + attribute + '="' + replace(toString(value), quot, '"') + '"';
return p1 + '>' + S + '</' + tag + '>';
};
typed-array-from.js 0000644 00000000011 15167731775 0010317 0 ustar 00 // empty
require-object-coercible.js 0000644 00000000532 15167731775 0011772 0 ustar 00 'use strict';
var isNullOrUndefined = require('../internals/is-null-or-undefined');
var $TypeError = TypeError;
// `RequireObjectCoercible` abstract operation
// https://tc39.es/ecma262/#sec-requireobjectcoercible
module.exports = function (it) {
if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
return it;
};
engine-webkit-version.js 0000644 00000000252 15167731775 0011337 0 ustar 00 'use strict';
var userAgent = require('../internals/engine-user-agent');
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
module.exports = !!webkit && +webkit[1];
symbol-constructor-detection.js 0000644 00000001653 15167731775 0012776 0 ustar 00 'use strict';
/* eslint-disable es/no-symbol -- required for testing */
var V8_VERSION = require('../internals/engine-v8-version');
var fails = require('../internals/fails');
var global = require('../internals/global');
var $String = global.String;
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
var symbol = Symbol('symbol detection');
// Chrome 38 Symbol has incorrect toString conversion
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
// of course, fail.
return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
});
array-reduce.js 0000644 00000002750 15167731775 0007514 0 ustar 00 'use strict';
var aCallable = require('../internals/a-callable');
var toObject = require('../internals/to-object');
var IndexedObject = require('../internals/indexed-object');
var lengthOfArrayLike = require('../internals/length-of-array-like');
var $TypeError = TypeError;
var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
// `Array.prototype.{ reduce, reduceRight }` methods implementation
var createMethod = function (IS_RIGHT) {
return function (that, callbackfn, argumentsLength, memo) {
var O = toObject(that);
var self = IndexedObject(O);
var length = lengthOfArrayLike(O);
aCallable(callbackfn);
if (length === 0 && argumentsLength < 2) throw new $TypeError(REDUCE_EMPTY);
var index = IS_RIGHT ? length - 1 : 0;
var i = IS_RIGHT ? -1 : 1;
if (argumentsLength < 2) while (true) {
if (index in self) {
memo = self[index];
index += i;
break;
}
index += i;
if (IS_RIGHT ? index < 0 : length <= index) {
throw new $TypeError(REDUCE_EMPTY);
}
}
for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
memo = callbackfn(memo, self[index], index, O);
}
return memo;
};
};
module.exports = {
// `Array.prototype.reduce` method
// https://tc39.es/ecma262/#sec-array.prototype.reduce
left: createMethod(false),
// `Array.prototype.reduceRight` method
// https://tc39.es/ecma262/#sec-array.prototype.reduceright
right: createMethod(true)
};
well-known-symbol-wrapped.js 0000644 00000000155 15167731775 0012166 0 ustar 00 'use strict';
var wellKnownSymbol = require('../internals/well-known-symbol');
exports.f = wellKnownSymbol;
create-property-descriptor.js 0000644 00000000273 15167731775 0012430 0 ustar 00 'use strict';
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
async-iterator-map.js 0000644 00000003674 15167731775 0010656 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var aCallable = require('../internals/a-callable');
var anObject = require('../internals/an-object');
var isObject = require('../internals/is-object');
var getIteratorDirect = require('../internals/get-iterator-direct');
var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
var createIterResultObject = require('../internals/create-iter-result-object');
var closeAsyncIteration = require('../internals/async-iterator-close');
var AsyncIteratorProxy = createAsyncIteratorProxy(function (Promise) {
var state = this;
var iterator = state.iterator;
var mapper = state.mapper;
return new Promise(function (resolve, reject) {
var doneAndReject = function (error) {
state.done = true;
reject(error);
};
var ifAbruptCloseAsyncIterator = function (error) {
closeAsyncIteration(iterator, doneAndReject, error, doneAndReject);
};
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));
};
if (isObject(result)) Promise.resolve(result).then(handler, ifAbruptCloseAsyncIterator);
else handler(result);
} catch (error2) { ifAbruptCloseAsyncIterator(error2); }
}
} catch (error) { doneAndReject(error); }
}, doneAndReject);
});
});
// `AsyncIterator.prototype.map` method
// https://github.com/tc39/proposal-iterator-helpers
module.exports = function map(mapper) {
anObject(this);
aCallable(mapper);
return new AsyncIteratorProxy(getIteratorDirect(this), {
mapper: mapper
});
};
make-built-in.js 0000644 00000000105 15167731776 0007560 0 ustar 00 'use strict';
module.exports = function (value) {
return value;
};
same-value.js 0000644 00000000502 15167731776 0007162 0 ustar 00 'use strict';
// `SameValue` abstract operation
// https://tc39.es/ecma262/#sec-samevalue
// eslint-disable-next-line es/no-object-is -- safe
module.exports = Object.is || function is(x, y) {
// eslint-disable-next-line no-self-compare -- NaN check
return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
};
async-iterator-wrap.js 0000644 00000000400 15167731776 0011033 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var createAsyncIteratorProxy = require('../internals/async-iterator-create-proxy');
module.exports = createAsyncIteratorProxy(function () {
return call(this.next, this.iterator);
}, true);
get-iterator-flattenable.js 0000644 00000000760 15167731776 0012016 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var anObject = require('../internals/an-object');
var getIteratorDirect = require('../internals/get-iterator-direct');
var getIteratorMethod = require('../internals/get-iterator-method');
module.exports = function (obj, stringHandling) {
if (!stringHandling || typeof obj !== 'string') anObject(obj);
var method = getIteratorMethod(obj);
return getIteratorDirect(anObject(method !== undefined ? call(method, obj) : obj));
};
an-object.js 0000644 00000000460 15167731776 0006770 0 ustar 00 'use strict';
var isObject = require('../internals/is-object');
var $String = String;
var $TypeError = TypeError;
// `Assert: Type(argument) is Object`
module.exports = function (argument) {
if (isObject(argument)) return argument;
throw new $TypeError($String(argument) + ' is not an object');
};
number-is-finite.js 0000644 00000000536 15167731776 0010307 0 ustar 00 'use strict';
var global = require('../internals/global');
var globalIsFinite = global.isFinite;
// `Number.isFinite` method
// https://tc39.es/ecma262/#sec-number.isfinite
// eslint-disable-next-line es/no-number-isfinite -- safe
module.exports = Number.isFinite || function isFinite(it) {
return typeof it == 'number' && globalIsFinite(it);
};
a-data-view.js 0000644 00000000364 15167731776 0007230 0 ustar 00 'use strict';
var classof = require('../internals/classof');
var $TypeError = TypeError;
module.exports = function (argument) {
if (classof(argument) === 'DataView') return argument;
throw new $TypeError('Argument is not a DataView');
};
object-to-string.js 0000644 00000000563 15167731776 0010324 0 ustar 00 'use strict';
var TO_STRING_TAG_SUPPORT = require('../internals/to-string-tag-support');
var classof = require('../internals/classof');
// `Object.prototype.toString` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.tostring
module.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
return '[object ' + classof(this) + ']';
};
number-parse-int.js 0000644 00000001661 15167731776 0010322 0 ustar 00 'use strict';
var global = require('../internals/global');
var fails = require('../internals/fails');
var uncurryThis = require('../internals/function-uncurry-this');
var toString = require('../internals/to-string');
var trim = require('../internals/string-trim').trim;
var whitespaces = require('../internals/whitespaces');
var $parseInt = global.parseInt;
var Symbol = global.Symbol;
var ITERATOR = Symbol && Symbol.iterator;
var hex = /^[+-]?0x/i;
var exec = uncurryThis(hex.exec);
var FORCED = $parseInt(whitespaces + '08') !== 8 || $parseInt(whitespaces + '0x16') !== 22
// MS Edge 18- broken with boxed symbols
|| (ITERATOR && !fails(function () { $parseInt(Object(ITERATOR)); }));
// `parseInt` method
// https://tc39.es/ecma262/#sec-parseint-string-radix
module.exports = FORCED ? function parseInt(string, radix) {
var S = trim(toString(string));
return $parseInt(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
} : $parseInt;
typed-array-from-species-and-list.js 0000644 00000000011 15167731776 0013462 0 ustar 00 // empty
set-iterate.js 0000644 00000000323 15167731776 0007352 0 ustar 00 'use strict';
var iterateSimple = require('../internals/iterate-simple');
module.exports = function (set, fn, interruptible) {
return interruptible ? iterateSimple(set.keys(), fn, true) : set.forEach(fn);
};
string-trim-end.js 0000644 00000000764 15167731776 0010160 0 ustar 00 'use strict';
var $trimEnd = require('../internals/string-trim').end;
var forcedStringTrimMethod = require('../internals/string-trim-forced');
// `String.prototype.{ trimEnd, trimRight }` method
// https://tc39.es/ecma262/#sec-string.prototype.trimend
// https://tc39.es/ecma262/#String.prototype.trimright
module.exports = forcedStringTrimMethod('trimEnd') ? function trimEnd() {
return $trimEnd(this);
// eslint-disable-next-line es/no-string-prototype-trimstart-trimend -- safe
} : ''.trimEnd;
function-uncurry-this.js 0000644 00000000573 15167731776 0011432 0 ustar 00 'use strict';
var NATIVE_BIND = require('../internals/function-bind-native');
var FunctionPrototype = Function.prototype;
var call = FunctionPrototype.call;
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
return function () {
return call.apply(fn, arguments);
};
};
symbol-define-to-primitive.js 0000644 00000001527 15167731776 0012316 0 ustar 00 'use strict';
var call = require('../internals/function-call');
var getBuiltIn = require('../internals/get-built-in');
var wellKnownSymbol = require('../internals/well-known-symbol');
var defineBuiltIn = require('../internals/define-built-in');
module.exports = function () {
var Symbol = getBuiltIn('Symbol');
var SymbolPrototype = Symbol && Symbol.prototype;
var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
// `Symbol.prototype[@@toPrimitive]` method
// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
// eslint-disable-next-line no-unused-vars -- required for .length
defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function (hint) {
return call(valueOf, this);
}, { arity: 1 });
}
};
is-object.js 0000644 00000000250 15167731776 0007002 0 ustar 00 'use strict';
var isCallable = require('../internals/is-callable');
module.exports = function (it) {
return typeof it == 'object' ? it !== null : isCallable(it);
};
correct-is-regexp-logic.js 0000644 00000000574 15167731776 0011571 0 ustar 00 'use strict';
var wellKnownSymbol = require('../internals/well-known-symbol');
var MATCH = wellKnownSymbol('match');
module.exports = function (METHOD_NAME) {
var regexp = /./;
try {
'/./'[METHOD_NAME](regexp);
} catch (error1) {
try {
regexp[MATCH] = false;
return '/./'[METHOD_NAME](regexp);
} catch (error2) { /* empty */ }
} return false;
};
an-instance.js 0000644 00000000376 15167731776 0007334 0 ustar 00 'use strict';
var isPrototypeOf = require('../internals/object-is-prototype-of');
var $TypeError = TypeError;
module.exports = function (it, Prototype) {
if (isPrototypeOf(Prototype, it)) return it;
throw new $TypeError('Incorrect invocation');
};
set-is-disjoint-from.js 0000644 00000001634 15167731776 0011120 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var has = require('../internals/set-helpers').has;
var size = require('../internals/set-size');
var getSetRecord = require('../internals/get-set-record');
var iterateSet = require('../internals/set-iterate');
var iterateSimple = require('../internals/iterate-simple');
var iteratorClose = require('../internals/iterator-close');
// `Set.prototype.isDisjointFrom` method
// https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
module.exports = function isDisjointFrom(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
if (otherRec.includes(e)) return false;
}, true) !== false;
var iterator = otherRec.getIterator();
return iterateSimple(iterator, function (e) {
if (has(O, e)) return iteratorClose(iterator, 'normal', false);
}) !== false;
};
advance-string-index.js 0000644 00000000430 15167731776 0011135 0 ustar 00 'use strict';
var charAt = require('../internals/string-multibyte').charAt;
// `AdvanceStringIndex` abstract operation
// https://tc39.es/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? charAt(S, index).length : 1);
};
set-intersection.js 0000644 00000001572 15167731776 0010432 0 ustar 00 'use strict';
var aSet = require('../internals/a-set');
var SetHelpers = require('../internals/set-helpers');
var size = require('../internals/set-size');
var getSetRecord = require('../internals/get-set-record');
var iterateSet = require('../internals/set-iterate');
var iterateSimple = require('../internals/iterate-simple');
var Set = SetHelpers.Set;
var add = SetHelpers.add;
var has = SetHelpers.has;
// `Set.prototype.intersection` method
// https://github.com/tc39/proposal-set-methods
module.exports = function intersection(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
var result = new Set();
if (size(O) > otherRec.size) {
iterateSimple(otherRec.getIterator(), function (e) {
if (has(O, e)) add(result, e);
});
} else {
iterateSet(O, function (e) {
if (otherRec.includes(e)) add(result, e);
});
}
return result;
};
string-multibyte.js 0000644 00000002607 15167731776 0010455 0 ustar 00 'use strict';
var uncurryThis = require('../internals/function-uncurry-this');
var toIntegerOrInfinity = require('../internals/to-integer-or-infinity');
var toString = require('../internals/to-string');
var requireObjectCoercible = require('../internals/require-object-coercible');
var charAt = uncurryThis(''.charAt);
var charCodeAt = uncurryThis(''.charCodeAt);
var stringSlice = uncurryThis(''.slice);
var createMethod = function (CONVERT_TO_STRING) {
return function ($this, pos) {
var S = toString(requireObjectCoercible($this));
var position = toIntegerOrInfinity(pos);
var size = S.length;
var first, second;
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
first = charCodeAt(S, position);
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
? CONVERT_TO_STRING
? charAt(S, position)
: first
: CONVERT_TO_STRING
? stringSlice(S, position, position + 2)
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
};
};
module.exports = {
// `String.prototype.codePointAt` method
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod(true)
};
delete-property-or-throw.js 0000644 00000000373 15167731776 0012034 0 ustar 00 'use strict';
var tryToString = require('../internals/try-to-string');
var $TypeError = TypeError;
module.exports = function (O, P) {
if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
};
typed-array-species-constructor.js 0000644 00000001102 15167731776 0013375 0 ustar 00 'use strict';
var ArrayBufferViewCore = require('../internals/array-buffer-view-core');
var speciesConstructor = require('../internals/species-constructor');
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
// a part of `TypedArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#typedarray-species-create
module.exports = function (originalArray) {
return aTypedArrayConstructor(speciesConstructor(originalArray, getTypedArrayConstructor(originalArray)));
};
inherit-if-required.js 0000644 00000001356 15167731776 0011007 0 ustar 00 'use strict';
var isCallable = require('../internals/is-callable');
var isObject = require('../internals/is-object');
var setPrototypeOf = require('../internals/object-set-prototype-of');
// makes subclassing work correct for wrapped built-ins
module.exports = function ($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (
// it can work only with native `setPrototypeOf`
setPrototypeOf &&
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
isCallable(NewTarget = dummy.constructor) &&
NewTarget !== Wrapper &&
isObject(NewTargetPrototype = NewTarget.prototype) &&
NewTargetPrototype !== Wrapper.prototype
) setPrototypeOf($this, NewTargetPrototype);
return $this;
};
array-fill.js 0000644 00000001370 15167731776 0007171 0 ustar 00 'use strict';
var toObject = require('../internals/to-object');
var toAbsoluteIndex = require('../internals/to-absolute-index');
var lengthOfArrayLike = require('../internals/length-of-array-like');
// `Array.prototype.fill` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.fill
module.exports = function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = lengthOfArrayLike(O);
var argumentsLength = arguments.length;
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
var end = argumentsLength > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};