1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-03 04:10:04 +02:00

update node modules

This commit is contained in:
s2
2021-05-07 15:56:33 +02:00
parent d81e8e9fb8
commit 3ec373077c
550 changed files with 84712 additions and 15991 deletions

12
node_modules/jsdom/lib/api.js generated vendored
View File

@@ -19,7 +19,7 @@ const NoOpResourceLoader = require("./jsdom/browser/resources/no-op-resource-loa
class CookieJar extends toughCookie.CookieJar {
constructor(store, options) {
// jsdom cookie jars must be loose by default
super(store, Object.assign({ looseMode: true }, options));
super(store, { looseMode: true, ...options });
}
}
@@ -27,7 +27,7 @@ const window = Symbol("window");
let sharedFragmentDocument = null;
class JSDOM {
constructor(input, options = {}) {
constructor(input = "", options = {}) {
const mimeType = new MIMEType(options.contentType === undefined ? "text/html" : options.contentType);
const { html, encoding } = normalizeHTML(input, mimeType);
@@ -163,7 +163,7 @@ function normalizeFromURLOptions(options) {
// Normalization of options which must be done before the rest of the fromURL code can use them, because they are
// given to request()
const normalized = Object.assign({}, options);
const normalized = { ...options };
if (options.referrer !== undefined) {
normalized.referrer = (new URL(options.referrer)).href;
@@ -180,7 +180,7 @@ function normalizeFromURLOptions(options) {
}
function normalizeFromFileOptions(filename, options) {
const normalized = Object.assign({}, options);
const normalized = { ...options };
if (normalized.contentType === undefined) {
const extname = path.extname(filename);
@@ -282,12 +282,10 @@ function transformOptions(options, encoding, mimeType) {
transformed.windowOptions.storageQuota = Number(options.storageQuota);
}
// concurrentNodeIterators??
return transformed;
}
function normalizeHTML(html = "", mimeType) {
function normalizeHTML(html, mimeType) {
let encoding = "UTF-8";
if (ArrayBuffer.isView(html)) {