Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "hlx-util", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "A library to preserve functions commonly used in hlxjs project", | ||
@@ -55,10 +55,10 @@ "main": "index.js", | ||
"devDependencies": { | ||
"ava": "^2.2.0", | ||
"coveralls": "^3.0.4", | ||
"ava": "^2.4.0", | ||
"coveralls": "^3.0.6", | ||
"nyc": "^14.1.1", | ||
"proxyquire": "^2.1.1", | ||
"proxyquire": "^2.1.3", | ||
"rewire": "^4.0.1", | ||
"sinon": "^7.3.2", | ||
"sinon": "^7.4.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
12
utils.js
@@ -96,3 +96,3 @@ const {URL} = require('url'); | ||
obj.hash = ''; | ||
if (obj.hostname && !obj.pathname.startsWith(obj.hostname, 1)) { | ||
if (obj.hostname && base && !obj.pathname.startsWith(obj.hostname, 1)) { | ||
obj.pathname = path.join('/', obj.hostname, obj.pathname); | ||
@@ -119,3 +119,2 @@ } | ||
let localPath; | ||
let obj; | ||
if (path.isAbsolute(uri)) { | ||
@@ -126,3 +125,3 @@ localPath = path.join(outputDir, uri); | ||
} | ||
obj = buildUrlObj(uri); | ||
const obj = buildUrlObj(uri, parentUri); | ||
if (obj) { | ||
@@ -133,9 +132,2 @@ localPath = buildAbsolutePath(obj.pathname, '/', inputDir, outputDir); | ||
} | ||
obj = buildUrlObj(parentUri); | ||
if (obj) { | ||
obj = buildUrlObj(uri, obj.href); | ||
localPath = buildAbsolutePath(obj.pathname, '/', inputDir, outputDir); | ||
print(`\tFrom relative url to localPath: ${localPath}`); | ||
return localPath; | ||
} | ||
localPath = buildAbsolutePath(uri, parentUri, inputDir, outputDir); | ||
@@ -142,0 +134,0 @@ print(`\tFrom relative path to localPath: ${localPath}`); |
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
6225
146