- Fix (npm): Update `load-stylesheets` to avoid recursion upon CSS loading errors
parent
8a4bca4e32
commit
3289131f7c
|
@ -24840,8 +24840,9 @@ function loadStylesheets(stylesheets) {
|
||||||
|
|
||||||
var link = document.createElement('link');
|
var link = document.createElement('link');
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
var rej = reject;
|
||||||
if (acceptErrors) {
|
if (acceptErrors) {
|
||||||
reject = typeof acceptErrors === 'function' ? function (error) {
|
rej = typeof acceptErrors === 'function' ? function (error) {
|
||||||
acceptErrors({ error: error, stylesheetURL: stylesheetURL, options: options, resolve: resolve, reject: reject });
|
acceptErrors({ error: error, stylesheetURL: stylesheetURL, options: options, resolve: resolve, reject: reject });
|
||||||
} : resolve;
|
} : resolve;
|
||||||
}
|
}
|
||||||
|
@ -24883,7 +24884,7 @@ function loadStylesheets(stylesheets) {
|
||||||
link.href = stylesheetURL;
|
link.href = stylesheetURL;
|
||||||
addLink();
|
addLink();
|
||||||
link.addEventListener('error', function (error) {
|
link.addEventListener('error', function (error) {
|
||||||
reject(error);
|
rej(error);
|
||||||
});
|
});
|
||||||
link.addEventListener('load', function () {
|
link.addEventListener('load', function () {
|
||||||
resolve(link);
|
resolve(link);
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -24846,8 +24846,9 @@
|
||||||
|
|
||||||
var link = document.createElement('link');
|
var link = document.createElement('link');
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
var rej = reject;
|
||||||
if (acceptErrors) {
|
if (acceptErrors) {
|
||||||
reject = typeof acceptErrors === 'function' ? function (error) {
|
rej = typeof acceptErrors === 'function' ? function (error) {
|
||||||
acceptErrors({ error: error, stylesheetURL: stylesheetURL, options: options, resolve: resolve, reject: reject });
|
acceptErrors({ error: error, stylesheetURL: stylesheetURL, options: options, resolve: resolve, reject: reject });
|
||||||
} : resolve;
|
} : resolve;
|
||||||
}
|
}
|
||||||
|
@ -24889,7 +24890,7 @@
|
||||||
link.href = stylesheetURL;
|
link.href = stylesheetURL;
|
||||||
addLink();
|
addLink();
|
||||||
link.addEventListener('error', function (error) {
|
link.addEventListener('error', function (error) {
|
||||||
reject(error);
|
rej(error);
|
||||||
});
|
});
|
||||||
link.addEventListener('load', function () {
|
link.addEventListener('load', function () {
|
||||||
resolve(link);
|
resolve(link);
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -29,8 +29,9 @@ function loadStylesheets(stylesheets, {
|
||||||
|
|
||||||
const link = document.createElement('link');
|
const link = document.createElement('link');
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
let rej = reject;
|
||||||
if (acceptErrors) {
|
if (acceptErrors) {
|
||||||
reject = typeof acceptErrors === 'function' ? error => {
|
rej = typeof acceptErrors === 'function' ? error => {
|
||||||
acceptErrors({ error, stylesheetURL, options, resolve, reject });
|
acceptErrors({ error, stylesheetURL, options, resolve, reject });
|
||||||
} : resolve;
|
} : resolve;
|
||||||
}
|
}
|
||||||
|
@ -72,7 +73,7 @@ function loadStylesheets(stylesheets, {
|
||||||
link.href = stylesheetURL;
|
link.href = stylesheetURL;
|
||||||
addLink();
|
addLink();
|
||||||
link.addEventListener('error', error => {
|
link.addEventListener('error', error => {
|
||||||
reject(error);
|
rej(error);
|
||||||
});
|
});
|
||||||
link.addEventListener('load', () => {
|
link.addEventListener('load', () => {
|
||||||
resolve(link);
|
resolve(link);
|
||||||
|
|
|
@ -4321,9 +4321,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"load-stylesheets": {
|
"load-stylesheets": {
|
||||||
"version": "0.6.1",
|
"version": "0.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/load-stylesheets/-/load-stylesheets-0.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/load-stylesheets/-/load-stylesheets-0.7.0.tgz",
|
||||||
"integrity": "sha512-TZyRbG1qZDNFRBUgt2AFE12LOhDYNylc/KD8q+ZWKxIL4Eg52UELBXGITCYpw7d1nelnkdzGbk+Epur7rzVBxg==",
|
"integrity": "sha512-GmNY6qV8uLCwgOC/U5UyeTxAh3Os//eTX+Y4644lcryBh81SPxNBA5GLVDB9rxUhXh8Oz0zT3mSCC1Wf4PP1oQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"locate-path": {
|
"locate-path": {
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
"find-in-files": "^0.5.0",
|
"find-in-files": "^0.5.0",
|
||||||
"imageoptim-cli": "^2.0.3",
|
"imageoptim-cli": "^2.0.3",
|
||||||
"jsdoc": "^3.5.5",
|
"jsdoc": "^3.5.5",
|
||||||
"load-stylesheets": "^0.6.1",
|
"load-stylesheets": "^0.7.0",
|
||||||
"node-static": "^0.7.10",
|
"node-static": "^0.7.10",
|
||||||
"opn-cli": "^3.1.0",
|
"opn-cli": "^3.1.0",
|
||||||
"qunit": "^2.6.1",
|
"qunit": "^2.6.1",
|
||||||
|
|
|
@ -24843,8 +24843,9 @@
|
||||||
|
|
||||||
var link = document.createElement('link');
|
var link = document.createElement('link');
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
|
var rej = reject;
|
||||||
if (acceptErrors) {
|
if (acceptErrors) {
|
||||||
reject = typeof acceptErrors === 'function' ? function (error) {
|
rej = typeof acceptErrors === 'function' ? function (error) {
|
||||||
acceptErrors({ error: error, stylesheetURL: stylesheetURL, options: options, resolve: resolve, reject: reject });
|
acceptErrors({ error: error, stylesheetURL: stylesheetURL, options: options, resolve: resolve, reject: reject });
|
||||||
} : resolve;
|
} : resolve;
|
||||||
}
|
}
|
||||||
|
@ -24886,7 +24887,7 @@
|
||||||
link.href = stylesheetURL;
|
link.href = stylesheetURL;
|
||||||
addLink();
|
addLink();
|
||||||
link.addEventListener('error', function (error) {
|
link.addEventListener('error', function (error) {
|
||||||
reject(error);
|
rej(error);
|
||||||
});
|
});
|
||||||
link.addEventListener('load', function () {
|
link.addEventListener('load', function () {
|
||||||
resolve(link);
|
resolve(link);
|
||||||
|
|
Loading…
Reference in New Issue