We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09b8eaf commit 120f059Copy full SHA for 120f059
lib/node.js
@@ -45,11 +45,17 @@ function load(url, encoding = "utf8"){
45
/**
46
* Normalise path separators.
47
*
48
+ * Well-formed URIs (those prefixed by `protocol://`)
49
+ * are returned unmodified unless `clobber` is truthy.
50
+ *
51
* @example "C:\User\foo\..\bar" -> "C:/User/bar"
52
* @param {String} input
53
+ * @param {Boolean} [clobber=false]
54
* @return {String}
55
*/
-function normalisePath(input){
56
+function normalisePath(input, clobber = false){
57
+ if(!clobber && /^\w*:\/\//.test(input))
58
+ return input;
59
input = resolve(input || "");
60
return "win32" === process.platform
61
? input.replace(/\\/g, "/")
0 commit comments