@hint/utils-network
Advanced tools
Comparing version 1.0.11 to 1.0.12
@@ -0,1 +1,8 @@ | ||
# 1.0.12 (October 29, 2021) | ||
## Bug fixes / Improvements | ||
* [[`2bb34e188a`](https://github.com/webhintio/hint/commit/2bb34e188aa7fa4666f1ab3c758fb0e56ec7a3eb)] - Fix: Restore handling relative file paths in getAsUri (by [`Tony Ross`](https://github.com/antross) / see also: [`#4836`](https://github.com/webhintio/hint/issues/4836)). | ||
# 1.0.11 (October 21, 2021) | ||
@@ -2,0 +9,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getAsUris = exports.getAsUri = void 0; | ||
const path = require("path"); | ||
const url = require("url"); | ||
@@ -27,3 +28,3 @@ const url_1 = require("url"); | ||
if (utils_fs_1.isFile(source) || utils_fs_1.isDirectory(source)) { | ||
target = new url_1.URL(`file://${source}`); | ||
target = new url_1.URL(`file://${path.resolve(source)}`); | ||
debug(`Adding valid target: ${url.format(target)}`); | ||
@@ -30,0 +31,0 @@ return target; |
@@ -33,1 +33,5 @@ "use strict"; | ||
}); | ||
ava_1.default('getAsUri resolves relative file paths', (t) => { | ||
const uri = src_1.getAsUri('.'); | ||
t.is(uri === null || uri === void 0 ? void 0 : uri.hostname, '', `getAsUri didn't resolve relative path to an absolute path`); | ||
}); |
@@ -68,3 +68,3 @@ { | ||
}, | ||
"version": "1.0.11" | ||
"version": "1.0.12" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
159753
552