Ajout de promotion et de commande

This commit is contained in:
Aubert Marvin
2026-04-25 15:28:39 +02:00
parent eddb103755
commit faa3d7718c
8428 changed files with 1126442 additions and 6 deletions
+130
View File
@@ -0,0 +1,130 @@
'use strict';
var $TypeError = require('es-errors/type');
var GetIntrinsic = require('get-intrinsic');
var callBound = require('call-bound');
var hasOwn = require('hasown');
var caseFolding = require('./caseFolding.json');
var IsArray = require('./IsArray');
var isLeadingSurrogate = require('./isLeadingSurrogate');
var isTrailingSurrogate = require('./isTrailingSurrogate');
var $charCodeAt = callBound('%String.prototype.charCodeAt%');
var $fromCharCode = GetIntrinsic('%String.fromCharCode%');
/* eslint func-style: 0 */
function CharSet(test, yieldCh) {
if (typeof test !== 'function') {
throw new $TypeError('Assertion failed: `test` must be a function');
}
if (typeof yieldCh !== 'function') {
throw new $TypeError('Assertion failed: `yield` must be a function');
}
this.test = test;
this.yield = yieldCh;
}
CharSet.prototype.count = function () {
var count = 0;
this.yield(function () { count += 1; });
return count;
};
function testCodeUnits(CharSetElement) {
if (typeof CharSetElement !== 'string') {
throw new $TypeError('Assertion failed: `CharSetElement` must be a string');
}
return CharSetElement.length !== 1;
}
function yieldCodeUnits(emit) {
for (var i = 0; i <= 0xDFFF; i += 1) {
emit($fromCharCode(i));
}
}
function testCodePoints(CharSetElement) {
if (typeof CharSetElement !== 'string') {
throw new $TypeError('Assertion failed: `CharSetElement` must be a string');
}
if (CharSetElement.length === 1) {
return true;
}
if (CharSetElement.length === 2) {
var hi = $charCodeAt(CharSetElement, 0);
var lo = $charCodeAt(CharSetElement, 1);
return isLeadingSurrogate(hi) && isTrailingSurrogate(lo);
}
return false;
}
function yieldCodePoints(emit) {
for (var i = 0; i <= 0xDFFF; i += 1) {
emit($fromCharCode(i));
}
for (var u = 0x10000; u <= 0x10FFFF; u += 1) {
var cp = u - 0x10000;
var high = (cp >> 10) + 0xD800;
var low = (cp & 0x3FF) + 0xDC00;
emit($fromCharCode(high, low));
}
}
function charsToMap(chars) {
if (!IsArray(chars)) {
throw new $TypeError('Assertion failed: `chars` must be an array');
}
var map = { __proto__: null };
for (var i = 0; i < chars.length; i += 1) {
var char = chars[i];
if (typeof char !== 'string' || (char.length !== 1 && char.length !== 2)) {
throw new $TypeError('Assertion failed: `chars` must be an array of strings of length 1');
}
map[char] = true;
}
return map;
}
module.exports = {
CharSet: CharSet,
from: function from(chars) {
var map = charsToMap(chars);
return new CharSet(
function test(CharSetElement) {
return hasOwn(map, CharSetElement);
},
function yieldChar(emit) {
// eslint-disable-next-line no-restricted-syntax
for (var k in map) {
if (hasOwn(map, k)) {
emit(k);
}
}
}
);
},
getCodeUnits: function () {
return new CharSet(testCodeUnits, yieldCodeUnits);
},
getCodePoints: function () {
return new CharSet(testCodePoints, yieldCodePoints);
},
getNonSimpleCaseFoldingCodePoints: function () {
return new CharSet(
function test(CharSetElement) {
return testCodePoints(CharSetElement) && !hasOwn(caseFolding.S, CharSetElement);
},
function yieldChar(emit) {
yieldCodePoints(function (CharSetElement) {
if (!hasOwn(caseFolding.S, CharSetElement)) {
emit(CharSetElement);
}
});
}
);
}
};
+53
View File
@@ -0,0 +1,53 @@
'use strict';
var hasPropertyDescriptors = require('has-property-descriptors');
var $defineProperty = require('es-define-property');
var hasArrayLengthDefineBug = hasPropertyDescriptors.hasArrayLengthDefineBug();
// eslint-disable-next-line global-require
var isArray = hasArrayLengthDefineBug && require('../helpers/IsArray');
var callBound = require('call-bound');
var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
// eslint-disable-next-line max-params
module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
if (!$defineProperty) {
if (!IsDataDescriptor(desc)) {
// ES3 does not support getters/setters
return false;
}
if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {
return false;
}
// fallback for ES3
if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
// a non-enumerable existing property
return false;
}
// property does not exist at all, or exists but is enumerable
var V = desc['[[Value]]'];
// eslint-disable-next-line no-param-reassign
O[P] = V; // will use [[Define]]
return SameValue(O[P], V);
}
if (
hasArrayLengthDefineBug
&& P === 'length'
&& '[[Value]]' in desc
&& isArray(O)
&& O.length !== desc['[[Value]]']
) {
// eslint-disable-next-line no-param-reassign
O.length = desc['[[Value]]'];
return O.length === desc['[[Value]]'];
}
$defineProperty(O, P, FromPropertyDescriptor(desc));
return true;
};
+12
View File
@@ -0,0 +1,12 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Array = GetIntrinsic('%Array%');
// eslint-disable-next-line global-require
var toStr = !$Array.isArray && require('call-bound')('Object.prototype.toString');
module.exports = $Array.isArray || function IsArray(argument) {
return toStr(argument) === '[object Array]';
};
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: remove
module.exports = require('own-keys');
+32
View File
@@ -0,0 +1,32 @@
'use strict';
// TODO, semver-major: delete this
var $TypeError = require('es-errors/type');
var $SyntaxError = require('es-errors/syntax');
var isMatchRecord = require('./records/match-record');
var isPropertyDescriptor = require('./records/property-descriptor');
var isIteratorRecord = require('./records/iterator-record-2023');
var isPromiseCapabilityRecord = require('./records/promise-capability-record');
var isAsyncGeneratorRequestRecord = require('./records/async-generator-request-record');
var isRegExpRecord = require('./records/regexp-record');
var predicates = {
'Property Descriptor': isPropertyDescriptor,
'Match Record': isMatchRecord,
'Iterator Record': isIteratorRecord,
'PromiseCapability Record': isPromiseCapabilityRecord,
'AsyncGeneratorRequest Record': isAsyncGeneratorRequestRecord,
'RegExp Record': isRegExpRecord
};
module.exports = function assertRecord(Type, recordType, argumentName, value) {
var predicate = predicates[recordType];
if (typeof predicate !== 'function') {
throw new $SyntaxError('unknown record type: ' + recordType);
}
if (!predicate(value)) {
throw new $TypeError(argumentName + ' must be a ' + recordType);
}
};
+22
View File
@@ -0,0 +1,22 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var hasOwn = require('hasown');
var $assign = GetIntrinsic('%Object.assign%', true);
module.exports = function assign(target, source) {
if ($assign) {
return $assign(target, source);
}
// eslint-disable-next-line no-restricted-syntax
for (var key in source) {
if (hasOwn(source, key)) {
// eslint-disable-next-line no-param-reassign
target[key] = source[key];
}
}
return target;
};
+47
View File
@@ -0,0 +1,47 @@
'use strict';
var $pow = require('math-intrinsics/pow');
module.exports = function bytesAsFloat32(rawBytes) {
// return new $Float16Array(new $Uint8Array(rawBytes).buffer)[0];
/*
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2019 binary16 value.
If value is a NaN, return NaN.
Return the Number value that corresponds to value.
*/
var bits = (rawBytes[1] << 8) | rawBytes[0];
// extract sign, exponent, mantissa
var sign = bits & 0x8000 ? -1 : 1;
var exponent = (bits & 0x7C00) >> 10;
var mantissa = bits & 0x03FF;
// zero (±0)
if (exponent === 0 && mantissa === 0) {
return sign === 1 ? 0 : -0;
}
// infinities
if (exponent === 0x1F && mantissa === 0) {
return sign === 1 ? Infinity : -Infinity;
}
// NaN
if (exponent === 0x1F && mantissa !== 0) {
return NaN;
}
// remove bias (15)
exponent -= 15;
// subnormals
if (exponent === -15) {
// value = sign * (mantissa) * 2^(1-bias-10) = mantissa * 2^(-14-10)
return sign * mantissa * $pow(2, -24);
}
// normals
// value = sign * (1 + mantissa/2^10) * 2^exponent
return sign * (1 + (mantissa * $pow(2, -10))) * $pow(2, exponent);
};
+36
View File
@@ -0,0 +1,36 @@
'use strict';
var $pow = require('math-intrinsics/pow');
module.exports = function bytesAsFloat32(rawBytes) {
// return new $Float32Array(new $Uint8Array(rawBytes).buffer)[0];
/*
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary32 value.
If value is an IEEE 754-2008 binary32 NaN value, return the NaN Number value.
Return the Number value that corresponds to value.
*/
var sign = rawBytes[3] & 0x80 ? -1 : 1; // Check the sign bit
var exponent = ((rawBytes[3] & 0x7F) << 1)
| (rawBytes[2] >> 7); // Combine bits for exponent
var mantissa = ((rawBytes[2] & 0x7F) << 16)
| (rawBytes[1] << 8)
| rawBytes[0]; // Combine bits for mantissa
if (exponent === 0 && mantissa === 0) {
return sign === 1 ? 0 : -0;
}
if (exponent === 0xFF && mantissa === 0) {
return sign === 1 ? Infinity : -Infinity;
}
if (exponent === 0xFF && mantissa !== 0) {
return NaN;
}
exponent -= 127; // subtract the bias
if (exponent === -127) {
return sign * mantissa * $pow(2, -126 - 23);
}
return sign * (1 + (mantissa * $pow(2, -23))) * $pow(2, exponent);
};
+42
View File
@@ -0,0 +1,42 @@
'use strict';
var $pow = require('math-intrinsics/pow');
module.exports = function bytesAsFloat64(rawBytes) {
// return new $Float64Array(new $Uint8Array(rawBytes).buffer)[0];
/*
Let value be the byte elements of rawBytes concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary64 value.
If value is an IEEE 754-2008 binary64 NaN value, return the NaN Number value.
Return the Number value that corresponds to value.
*/
var sign = rawBytes[7] & 0x80 ? -1 : 1; // first bit
var exponent = ((rawBytes[7] & 0x7F) << 4) // 7 bits from index 7
| ((rawBytes[6] & 0xF0) >> 4); // 4 bits from index 6
var mantissa = ((rawBytes[6] & 0x0F) * 0x1000000000000) // 4 bits from index 6
+ (rawBytes[5] * 0x10000000000) // 8 bits from index 5
+ (rawBytes[4] * 0x100000000) // 8 bits from index 4
+ (rawBytes[3] * 0x1000000) // 8 bits from index 3
+ (rawBytes[2] * 0x10000) // 8 bits from index 2
+ (rawBytes[1] * 0x100) // 8 bits from index 1
+ rawBytes[0]; // 8 bits from index 0
if (exponent === 0 && mantissa === 0) {
return sign * 0;
}
if (exponent === 0x7FF && mantissa !== 0) {
return NaN;
}
if (exponent === 0x7FF && mantissa === 0) {
return sign * Infinity;
}
exponent -= 1023; // subtract the bias
// Handle subnormal numbers
if (exponent === -1023) {
return sign * mantissa * 5e-324; // $pow(2, -1022 - 52)
}
return sign * (1 + (mantissa / 0x10000000000000)) * $pow(2, exponent);
};
+32
View File
@@ -0,0 +1,32 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $pow = require('math-intrinsics/pow');
var $Number = GetIntrinsic('%Number%');
var $BigInt = GetIntrinsic('%BigInt%', true);
module.exports = function bytesAsInteger(rawBytes, elementSize, isUnsigned, isBigInt) {
var Z = isBigInt ? $BigInt : $Number;
// this is common to both branches
var intValue = Z(0);
for (var i = 0; i < rawBytes.length; i++) {
intValue += Z(rawBytes[i] * $pow(2, 8 * i));
}
/*
Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number.
*/
if (!isUnsigned) { // steps 5-6
// Let intValue be the byte elements of rawBytes concatenated and interpreted as a bit string encoding of a binary little-endian 2's complement number of bit length elementSize × 8.
var bitLength = elementSize * 8;
if (rawBytes[elementSize - 1] & 0x80) {
intValue -= Z($pow(2, bitLength));
}
}
return intValue; // step 7
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
// TODO; semver-major: remove
module.exports = require('call-bind');
+5
View File
@@ -0,0 +1,5 @@
'use strict';
// TODO; semver-major: remove
module.exports = require('call-bound');
+1430
View File
File diff suppressed because it is too large Load Diff
+21
View File
@@ -0,0 +1,21 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Uint8Array = GetIntrinsic('%Uint8Array%', true);
var $Uint32Array = GetIntrinsic('%Uint32Array%', true);
var typedArrayBuffer = require('typed-array-buffer');
var uInt32 = $Uint32Array && new $Uint32Array([0x12345678]);
var uInt8 = uInt32 && new $Uint8Array(typedArrayBuffer(uInt32));
module.exports = uInt8
? uInt8[0] === 0x78
? 'little'
: uInt8[0] === 0x12
? 'big'
: uInt8[0] === 0x34
? 'mixed' // https://developer.mozilla.org/en-US/docs/Glossary/Endianness
: 'unknown' // ???
: 'indeterminate'; // no way to know
+10
View File
@@ -0,0 +1,10 @@
'use strict';
module.exports = function every(array, predicate) {
for (var i = 0; i < array.length; i += 1) {
if (!predicate(array[i], i, array)) {
return false;
}
}
return true;
};
+7
View File
@@ -0,0 +1,7 @@
'use strict';
module.exports = function forEach(array, callback) {
for (var i = 0; i < array.length; i += 1) {
callback(array[i], i, array); // eslint-disable-line callback-return
}
};
+33
View File
@@ -0,0 +1,33 @@
'use strict';
var MAX_ITER = 1075; // 1023+52 (subnormals) => BIAS+NUM_SIGNFICAND_BITS-1
var maxBits = 54; // only 53 bits for fraction
module.exports = function fractionToBitString(x) {
var str = '';
if (x === 0) {
return str;
}
var j = MAX_ITER;
var y;
// Each time we multiply by 2 and find a ones digit, add a '1'; otherwise, add a '0'..
for (var i = 0; i < MAX_ITER; i += 1) {
y = x * 2;
if (y >= 1) {
x = y - 1; // eslint-disable-line no-param-reassign
str += '1';
if (j === MAX_ITER) {
j = i; // first 1
}
} else {
x = y; // eslint-disable-line no-param-reassign
str += '0';
}
// Stop when we have no more decimals to process or in the event we found a fraction which cannot be represented in a finite number of bits...
if (y === 1 || i - j > maxBits) {
return str;
}
}
return str;
};
+27
View File
@@ -0,0 +1,27 @@
'use strict';
module.exports = function fromPropertyDescriptor(Desc) {
if (typeof Desc === 'undefined') {
return Desc;
}
var obj = {};
if ('[[Value]]' in Desc) {
obj.value = Desc['[[Value]]'];
}
if ('[[Writable]]' in Desc) {
obj.writable = !!Desc['[[Writable]]'];
}
if ('[[Get]]' in Desc) {
obj.get = Desc['[[Get]]'];
}
if ('[[Set]]' in Desc) {
obj.set = Desc['[[Set]]'];
}
if ('[[Enumerable]]' in Desc) {
obj.enumerable = !!Desc['[[Enumerable]]'];
}
if ('[[Configurable]]' in Desc) {
obj.configurable = !!Desc['[[Configurable]]'];
}
return obj;
};
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO: remove, semver-major
module.exports = require('get-symbol-description/getInferredName');
+50
View File
@@ -0,0 +1,50 @@
'use strict';
var hasSymbols = require('has-symbols')();
var GetIntrinsic = require('get-intrinsic');
var callBound = require('call-bound');
var isString = require('is-string');
var $iterator = GetIntrinsic('%Symbol.iterator%', true);
var $stringSlice = callBound('String.prototype.slice');
var $String = GetIntrinsic('%String%');
var IsArray = require('./IsArray');
module.exports = function getIteratorMethod(ES, iterable) {
var usingIterator;
if (hasSymbols) {
usingIterator = ES.GetMethod(iterable, $iterator);
} else if (IsArray(iterable)) {
usingIterator = function () {
var i = -1;
var arr = this;
return {
next: function () {
i += 1;
return {
done: i >= arr.length,
value: arr[i]
};
}
};
};
} else if (isString(iterable)) {
usingIterator = function () {
var i = 0;
return {
next: function () {
var nextIndex = ES.AdvanceStringIndex($String(iterable), i, true);
var value = $stringSlice(iterable, i, nextIndex);
i = nextIndex;
var done = nextIndex > iterable.length;
return {
done: done,
value: done ? void undefined : value
};
}
};
};
}
return usingIterator;
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
// TODO: remove, semver-major
module.exports = require('gopd');
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: remove
module.exports = require('get-proto');
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO: remove, semver-major
module.exports = require('get-symbol-description');
+21
View File
@@ -0,0 +1,21 @@
'use strict';
var $floor = require('math-intrinsics/floor');
// https://runestone.academy/ns/books/published/pythonds/BasicDS/ConvertingDecimalNumberstoBinaryNumbers.html#:~:text=The%20Divide%20by%202%20algorithm,have%20a%20remainder%20of%200
module.exports = function intToBinaryString(x) {
var str = '';
var y;
while (x > 0) {
y = x / 2;
x = $floor(y); // eslint-disable-line no-param-reassign
if (y === x) {
str = '0' + str;
} else {
str = '1' + str;
}
}
return str;
};
+28
View File
@@ -0,0 +1,28 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $Number = GetIntrinsic('%Number%');
var $BigInt = GetIntrinsic('%BigInt%', true);
module.exports = function integerToNBytes(intValue, n, isLittleEndian) {
var Z = typeof intValue === 'bigint' ? $BigInt : $Number;
/*
if (intValue >= 0) { // step 3.d
// Let rawBytes be a List containing the n-byte binary encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
} else { // step 3.e
// Let rawBytes be a List containing the n-byte binary 2's complement encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.
}
*/
if (intValue < 0) {
intValue >>>= 0; // eslint-disable-line no-param-reassign
}
var rawBytes = [];
for (var i = 0; i < n; i++) {
rawBytes[isLittleEndian ? i : n - 1 - i] = $Number(intValue & Z(0xFF));
intValue >>= Z(8); // eslint-disable-line no-param-reassign
}
return rawBytes; // step 4
};
+9
View File
@@ -0,0 +1,9 @@
'use strict';
var functionName = require('function.prototype.name');
var anon = functionName(function () {});
module.exports = function isAbstractClosure(x) {
return typeof x === 'function' && (!x.prototype || functionName(x) === anon);
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isByteValue(value) {
return typeof value === 'number' && value >= 0 && value <= 255 && (value | 0) === value;
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isCodePoint(cp) {
return typeof cp === 'number' && cp >= 0 && cp <= 0x10FFFF && (cp | 0) === cp;
};
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: delete
module.exports = require('math-intrinsics/isFinite');
+10
View File
@@ -0,0 +1,10 @@
'use strict';
var isPropertyDescriptor = require('./records/property-descriptor');
module.exports = function isFullyPopulatedPropertyDescriptor(ES, Desc) {
return isPropertyDescriptor(Desc)
&& '[[Enumerable]]' in Desc
&& '[[Configurable]]' in Desc
&& (ES.IsAccessorDescriptor(Desc) || ES.IsDataDescriptor(Desc));
};
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: delete
module.exports = require('math-intrinsics/isInteger');
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isLeadingSurrogate(charCode) {
return typeof charCode === 'number' && charCode >= 0xD800 && charCode <= 0xDBFF;
};
+7
View File
@@ -0,0 +1,7 @@
'use strict';
// https://262.ecma-international.org/5.1/#sec-7.3
module.exports = function isLineTerminator(c) {
return c === '\n' || c === '\r' || c === '\u2028' || c === '\u2029';
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = Number.isNaN || function isNaN(a) {
return a !== a;
};
+6
View File
@@ -0,0 +1,6 @@
'use strict';
// TODO, semver-major: remove
module.exports = function isNegativeZero(x) {
return x === 0 && 1 / x === 1 / -0;
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
// TODO: remove, semver-major
module.exports = require('es-object-atoms/isObject');
+13
View File
@@ -0,0 +1,13 @@
'use strict';
var $strSlice = require('call-bound')('String.prototype.slice');
module.exports = function isPrefixOf(prefix, string) {
if (prefix === string) {
return true;
}
if (prefix.length > string.length) {
return false;
}
return $strSlice(string, 0, prefix.length) === prefix;
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isPrimitive(value) {
return value === null || (typeof value !== 'function' && typeof value !== 'object');
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isPropertyKey(argument) {
return typeof argument === 'string' || typeof argument === 'symbol';
};
+20
View File
@@ -0,0 +1,20 @@
'use strict';
var every = require('./every');
module.exports = function isSamePropertyDescriptor(ES, D1, D2) {
var fields = [
'[[Configurable]]',
'[[Enumerable]]',
'[[Get]]',
'[[Set]]',
'[[Value]]',
'[[Writable]]'
];
return every(fields, function (field) {
if ((field in D1) !== (field in D2)) {
return false;
}
return ES.SameValue(D1[field], D2[field]);
});
};
+16
View File
@@ -0,0 +1,16 @@
'use strict';
module.exports = function isSameType(x, y) {
if (x === y) {
return true;
}
if (typeof x === typeof y) {
if (typeof x !== 'object' || typeof y !== 'object') {
return true;
}
return !!x === !!y;
}
return false;
};
+9
View File
@@ -0,0 +1,9 @@
'use strict';
// TODO: semver-major: remove
var canDistinguishSparseFromUndefined = 0 in [undefined]; // IE 6 - 8 have a bug where this returns false
module.exports = function isStringOrHole(item, index, arr) {
return typeof item === 'string' || (canDistinguishSparseFromUndefined ? !(index in arr) : typeof item === 'undefined');
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isStringOrUndefined(item) {
return typeof item === 'string' || typeof item === 'undefined';
};
+5
View File
@@ -0,0 +1,5 @@
'use strict';
module.exports = function isTrailingSurrogate(charCode) {
return typeof charCode === 'number' && charCode >= 0xDC00 && charCode <= 0xDFFF;
};
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: delete
module.exports = require('math-intrinsics/constants/maxSafeInteger');
+3
View File
@@ -0,0 +1,3 @@
'use strict';
module.exports = Number.MAX_VALUE || 1.7976931348623157e+308;
+4
View File
@@ -0,0 +1,4 @@
'use strict';
// TODO, semver-major: delete
module.exports = require('math-intrinsics/mod');
+6
View File
@@ -0,0 +1,6 @@
'use strict';
module.exports = function bigIntMod(BigIntRemainder, bigint, modulo) {
var remain = BigIntRemainder(bigint, modulo);
return remain >= 0 ? remain : remain + modulo;
};
+9
View File
@@ -0,0 +1,9 @@
'use strict';
var callBound = require('call-bound');
var $strSlice = callBound('String.prototype.slice');
module.exports = function padTimeComponent(c, count) {
return $strSlice('00' + c, -(count || 2));
};
@@ -0,0 +1,13 @@
'use strict';
var hasOwn = require('hasown');
var isPromiseCapabilityRecord = require('./promise-capability-record');
module.exports = function isAsyncGeneratorRequestRecord(value) {
return !!value
&& typeof value === 'object'
&& hasOwn(value, '[[Completion]]') // TODO: confirm is a completion record
&& hasOwn(value, '[[Capability]]')
&& isPromiseCapabilityRecord(value['[[Capability]]']);
};

Some files were not shown because too many files have changed in this diff Show More