Skip to content

Commit

Permalink
[Fix] sync/async: Fixes isCore check (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis authored and ljharb committed Jan 6, 2020
1 parent 2f0e047 commit b261110
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
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,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
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,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 b261110

Please sign in to comment.