We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7923b4a commit 140b44fCopy full SHA for 140b44f
lib/internal/modules/cjs/loader.js
@@ -838,7 +838,7 @@ Module.runMain = function() {
838
function createRequireFromPath(filename) {
839
// Allow a directory to be passed as the filename
840
const trailingSlash =
841
- filename.endsWith(path.sep) || path.sep !== '/' && filename.endsWith('\\');
+ filename.endsWith('/') || (isWindows && filename.endsWith('\\'));
842
843
const proxyPath = trailingSlash ?
844
path.join(filename, 'noop.js') :
0 commit comments