Skip to content

Commit

Permalink
Avoid normalising well-formed URIs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Alhadis committed Dec 20, 2017
1 parent 09b8eaf commit 120f059
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ function load(url, encoding = "utf8"){
/**
* Normalise path separators.
*
* Well-formed URIs (those prefixed by `protocol://`)
* are returned unmodified unless `clobber` is truthy.
*
* @example "C:\User\foo\..\bar" -> "C:/User/bar"
* @param {String} input
* @param {Boolean} [clobber=false]
* @return {String}
*/
function normalisePath(input){
function normalisePath(input, clobber = false){
if(!clobber && /^\w*:\/\//.test(input))
return input;
input = resolve(input || "");
return "win32" === process.platform
? input.replace(/\\/g, "/")
Expand Down

0 comments on commit 120f059

Please sign in to comment.