async-define
Advanced tools
Comparing version 3.0.4 to 3.1.0
@@ -97,5 +97,25 @@ (function (cb){ | ||
} | ||
cb.call(w, ad); | ||
}(function (define) { | ||
function ie(moduleName, iecb) { | ||
var script = document.querySelector('script#' + moduleName); | ||
var link = document.querySelector('link#' + moduleName); | ||
if (!script && link) { | ||
var src = link.href; | ||
script = document.createElement('script'); | ||
script.id = moduleName; | ||
script.src = src; | ||
document.head.appendChild(script); | ||
} | ||
if (!('Promise' in w)) { | ||
return ad([moduleName], iecb); | ||
} | ||
return new Promise(function (resolve) { | ||
ad([moduleName], resolve); | ||
}); | ||
} | ||
cb.call(w, ad, ie); | ||
}(function (define, importExternal) { | ||
if (typeof exports === 'object'){ | ||
define.importExternal = importExternal; | ||
module.exports = define; | ||
@@ -105,2 +125,3 @@ } | ||
this.asyncDefine = define; | ||
this.importExternal = importExternal; | ||
} | ||
@@ -107,0 +128,0 @@ |
{ | ||
"name": "async-define", | ||
"version": "3.0.4", | ||
"version": "3.1.0", | ||
"description": "Coordinate the execution of asynchronous scripts", | ||
@@ -5,0 +5,0 @@ "main": "lib/asyncDefine.js", |
if (typeof exports === 'object'){ | ||
define.importExternal = importExternal; | ||
module.exports = define; | ||
@@ -6,2 +7,3 @@ } | ||
this.asyncDefine = define; | ||
this.importExternal = importExternal; | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21831
338