Skip to content

Commit

Permalink
Make require.resolve consistent between '.' and './'
Browse files Browse the repository at this point in the history
  • Loading branch information
pouwerkerk authored Mar 8, 2023
1 parent b8ef1b4 commit 190d94a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,8 @@ Module._resolveFilename = function(request, parent, isMain, options) {
const isRelative = StringPrototypeStartsWith(request, './') ||
StringPrototypeStartsWith(request, '../') ||
((isWindows && StringPrototypeStartsWith(request, '.\\')) ||
StringPrototypeStartsWith(request, '..\\'));
StringPrototypeStartsWith(request, '..\\')) ||
request === '..' || request === '.';

if (isRelative) {
paths = options.paths;
Expand Down

0 comments on commit 190d94a

Please sign in to comment.