- Fix (npm): Update `load-stylesheets` to avoid recursion upon CSS loading errors

master
Brett Zamir 2018-07-18 21:10:05 -07:00
parent 8a4bca4e32
commit 3289131f7c
10 changed files with 20 additions and 16 deletions

5
dist/index-es.js vendored
View File

@ -24840,8 +24840,9 @@ function loadStylesheets(stylesheets) {
var link = document.createElement('link');
return new Promise(function (resolve, reject) {
var rej = reject;
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 });
} : resolve;
}
@ -24883,7 +24884,7 @@ function loadStylesheets(stylesheets) {
link.href = stylesheetURL;
addLink();
link.addEventListener('error', function (error) {
reject(error);
rej(error);
});
link.addEventListener('load', function () {
resolve(link);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

5
dist/index-umd.js vendored
View File

@ -24846,8 +24846,9 @@
var link = document.createElement('link');
return new Promise(function (resolve, reject) {
var rej = reject;
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 });
} : resolve;
}
@ -24889,7 +24890,7 @@
link.href = stylesheetURL;
addLink();
link.addEventListener('error', function (error) {
reject(error);
rej(error);
});
link.addEventListener('load', function () {
resolve(link);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -29,8 +29,9 @@ function loadStylesheets(stylesheets, {
const link = document.createElement('link');
return new Promise((resolve, reject) => {
let rej = reject;
if (acceptErrors) {
reject = typeof acceptErrors === 'function' ? error => {
rej = typeof acceptErrors === 'function' ? error => {
acceptErrors({ error, stylesheetURL, options, resolve, reject });
} : resolve;
}
@ -72,7 +73,7 @@ function loadStylesheets(stylesheets, {
link.href = stylesheetURL;
addLink();
link.addEventListener('error', error => {
reject(error);
rej(error);
});
link.addEventListener('load', () => {
resolve(link);

6
package-lock.json generated
View File

@ -4321,9 +4321,9 @@
}
},
"load-stylesheets": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/load-stylesheets/-/load-stylesheets-0.6.1.tgz",
"integrity": "sha512-TZyRbG1qZDNFRBUgt2AFE12LOhDYNylc/KD8q+ZWKxIL4Eg52UELBXGITCYpw7d1nelnkdzGbk+Epur7rzVBxg==",
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/load-stylesheets/-/load-stylesheets-0.7.0.tgz",
"integrity": "sha512-GmNY6qV8uLCwgOC/U5UyeTxAh3Os//eTX+Y4644lcryBh81SPxNBA5GLVDB9rxUhXh8Oz0zT3mSCC1Wf4PP1oQ==",
"dev": true
},
"locate-path": {

View File

@ -66,7 +66,7 @@
"find-in-files": "^0.5.0",
"imageoptim-cli": "^2.0.3",
"jsdoc": "^3.5.5",
"load-stylesheets": "^0.6.1",
"load-stylesheets": "^0.7.0",
"node-static": "^0.7.10",
"opn-cli": "^3.1.0",
"qunit": "^2.6.1",

View File

@ -24843,8 +24843,9 @@
var link = document.createElement('link');
return new Promise(function (resolve, reject) {
var rej = reject;
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 });
} : resolve;
}
@ -24886,7 +24887,7 @@
link.href = stylesheetURL;
addLink();
link.addEventListener('error', function (error) {
reject(error);
rej(error);
});
link.addEventListener('load', function () {
resolve(link);