import-html-entry
Advanced tools
Comparing version 1.14.5 to 1.14.6
@@ -28,3 +28,3 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray"; | ||
function hasProtocol(url) { | ||
return url.startsWith('//') || url.startsWith('http://') || url.startsWith('https://'); | ||
return url.startsWith('http://') || url.startsWith('https://'); | ||
} | ||
@@ -132,9 +132,11 @@ function getEntirePath(path, baseURI) { | ||
throw new SyntaxError('You should not set multiply entry script!'); | ||
} else { | ||
// append the domain while the script not have an protocol prefix | ||
if (matchedScriptSrc && !hasProtocol(matchedScriptSrc)) { | ||
} | ||
if (matchedScriptSrc) { | ||
// append the domain while the script not have a protocol prefix | ||
if (!hasProtocol(matchedScriptSrc)) { | ||
matchedScriptSrc = getEntirePath(matchedScriptSrc, baseURI); | ||
} | ||
entry = entry || matchedScriptEntry && matchedScriptSrc; | ||
matchedScriptSrc = parseUrl(matchedScriptSrc); | ||
} | ||
entry = entry || matchedScriptEntry && matchedScriptSrc; | ||
if (scriptIgnore) { | ||
@@ -148,3 +150,2 @@ return genIgnoreAssetReplaceSymbol(matchedScriptSrc || 'js file'); | ||
var asyncScript = !!scriptTag.match(SCRIPT_ASYNC_REGEX); | ||
matchedScriptSrc = parseUrl(matchedScriptSrc); | ||
scripts.push(asyncScript ? { | ||
@@ -151,0 +152,0 @@ async: true, |
@@ -37,3 +37,3 @@ "use strict"; | ||
function hasProtocol(url) { | ||
return url.startsWith('//') || url.startsWith('http://') || url.startsWith('https://'); | ||
return url.startsWith('http://') || url.startsWith('https://'); | ||
} | ||
@@ -146,9 +146,11 @@ function getEntirePath(path, baseURI) { | ||
throw new SyntaxError('You should not set multiply entry script!'); | ||
} else { | ||
// append the domain while the script not have an protocol prefix | ||
if (matchedScriptSrc && !hasProtocol(matchedScriptSrc)) { | ||
} | ||
if (matchedScriptSrc) { | ||
// append the domain while the script not have a protocol prefix | ||
if (!hasProtocol(matchedScriptSrc)) { | ||
matchedScriptSrc = getEntirePath(matchedScriptSrc, baseURI); | ||
} | ||
entry = entry || matchedScriptEntry && matchedScriptSrc; | ||
matchedScriptSrc = (0, _utils.parseUrl)(matchedScriptSrc); | ||
} | ||
entry = entry || matchedScriptEntry && matchedScriptSrc; | ||
if (scriptIgnore) { | ||
@@ -162,3 +164,2 @@ return genIgnoreAssetReplaceSymbol(matchedScriptSrc || 'js file'); | ||
var asyncScript = !!scriptTag.match(SCRIPT_ASYNC_REGEX); | ||
matchedScriptSrc = (0, _utils.parseUrl)(matchedScriptSrc); | ||
scripts.push(asyncScript ? { | ||
@@ -165,0 +166,0 @@ async: true, |
{ | ||
"name": "import-html-entry", | ||
"version": "1.14.5", | ||
"version": "1.14.6", | ||
"description": "import html and get the exports of entry", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
Potential vulnerability
Supply chain riskInitial human review suggests the presence of a vulnerability in this package. It is pending further analysis and confirmation.
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
1458
73715
33