Skip to content

Commit

Permalink
Fixes isCore bug
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis authored and ljharb committed Jan 5, 2020
1 parent b192e97 commit 4d138d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/async.js
Expand Up @@ -105,9 +105,10 @@ module.exports = function resolve(x, options, callback) {
if ((/\/$/).test(x) && res === basedir) {
loadAsDirectory(res, opts.package, onfile);
} else loadAsFile(res, opts.package, onfile);
} else if (isCore(x)) {
return cb(null, x);
} else loadNodeModules(x, basedir, function (err, n, pkg) {
if (err) cb(err);
else if (isCore(x)) return cb(null, x);
else if (n) {
return maybeUnwrapSymlink(n, opts, function (err, realN) {
if (err) {
Expand Down
2 changes: 0 additions & 2 deletions lib/sync.js
Expand Up @@ -84,8 +84,6 @@ module.exports = function (x, options) {
if (n) return maybeUnwrapSymlink(n, opts);
}

if (isCore(x)) return x;

var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
err.code = 'MODULE_NOT_FOUND';
throw err;
Expand Down

0 comments on commit 4d138d7

Please sign in to comment.