Skip to content

Commit

Permalink
fixup: use non-normalized form for compat concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
bmeck committed Mar 18, 2022
1 parent 5665ab8 commit 2af1174
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/internal/modules/cjs/loader.js
Expand Up @@ -522,13 +522,10 @@ Module._findPath = function(request, paths, isMain) {

const isRelative = RegExpPrototypeTest(isWindows ? windowsRelativeCheck : nixRelativeCheck, request);
let insidePath = true;
let normalizedRequest = request;
if (isRelative) {
normalizedRequest = path.normalize(request);
const normalizedRequest = path.normalize(request);
if (StringPrototypeStartsWith(normalizedRequest, '..')) {
insidePath = false;
} else {
normalizedRequest = `./${normalizedRequest}`;
}
}

Expand Down

0 comments on commit 2af1174

Please sign in to comment.