mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-04 12:40:05 +02:00
update modules
This commit is contained in:
40
node_modules/whatwg-url/lib/utils.js
generated
vendored
40
node_modules/whatwg-url/lib/utils.js
generated
vendored
@@ -9,34 +9,10 @@ function hasOwn(obj, prop) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, prop);
|
||||
}
|
||||
|
||||
const getOwnPropertyDescriptors = typeof Object.getOwnPropertyDescriptors === "function" ?
|
||||
Object.getOwnPropertyDescriptors :
|
||||
// Polyfill exists until we require Node.js v8.x
|
||||
// https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
|
||||
obj => {
|
||||
if (obj === undefined || obj === null) {
|
||||
throw new TypeError("Cannot convert undefined or null to object");
|
||||
}
|
||||
obj = Object(obj);
|
||||
const ownKeys = Reflect.ownKeys(obj);
|
||||
const descriptors = {};
|
||||
for (const key of ownKeys) {
|
||||
const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
|
||||
if (descriptor !== undefined) {
|
||||
Reflect.defineProperty(descriptors, key, {
|
||||
value: descriptor,
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
}
|
||||
return descriptors;
|
||||
};
|
||||
|
||||
const wrapperSymbol = Symbol("wrapper");
|
||||
const implSymbol = Symbol("impl");
|
||||
const sameObjectCaches = Symbol("SameObject caches");
|
||||
const ctorRegistrySymbol = Symbol.for("[webidl2js] constructor registry");
|
||||
|
||||
function getSameObject(wrapper, prop, creator) {
|
||||
if (!wrapper[sameObjectCaches]) {
|
||||
@@ -87,6 +63,17 @@ function isArrayIndexPropName(P) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const byteLengthGetter =
|
||||
Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, "byteLength").get;
|
||||
function isArrayBuffer(value) {
|
||||
try {
|
||||
byteLengthGetter.call(value);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
const supportsPropertyIndex = Symbol("supports property index");
|
||||
const supportedPropertyIndices = Symbol("supported property indices");
|
||||
const supportsPropertyName = Symbol("supports property name");
|
||||
@@ -102,16 +89,17 @@ const namedDelete = Symbol("named property delete");
|
||||
module.exports = exports = {
|
||||
isObject,
|
||||
hasOwn,
|
||||
getOwnPropertyDescriptors,
|
||||
wrapperSymbol,
|
||||
implSymbol,
|
||||
getSameObject,
|
||||
ctorRegistrySymbol,
|
||||
wrapperForImpl,
|
||||
implForWrapper,
|
||||
tryWrapperForImpl,
|
||||
tryImplForWrapper,
|
||||
iterInternalSymbol,
|
||||
IteratorPrototype,
|
||||
isArrayBuffer,
|
||||
isArrayIndexPropName,
|
||||
supportsPropertyIndex,
|
||||
supportedPropertyIndices,
|
||||
|
Reference in New Issue
Block a user