We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70146a5 commit 5ebb39aCopy full SHA for 5ebb39a
lib/async.js
@@ -171,15 +171,20 @@ module.exports = function resolve (x, opts, cb) {
171
if (dirs.length === 0) return cb(null, undefined);
172
var dir = dirs[0];
173
174
- loadAsFile(path.join(dir, '/', x), undefined, function (err, m, pkg) {
+ var file = path.join(dir, '/', x);
175
+ loadAsFile(file, undefined, onfile);
176
+
177
+ function onfile (err, m, pkg) {
178
if (err) return cb(err);
179
if (m) return cb(null, m, pkg);
- loadAsDirectory(path.join(dir, '/', x), undefined, function (err, n, pkg) {
- if (err) return cb(err);
- if (n) return cb(null, n, pkg);
180
- process(dirs.slice(1));
181
- });
182
+ loadAsDirectory(path.join(dir, '/', x), undefined, ondir);
+ }
183
+ function ondir (err, n, pkg) {
184
+ if (err) return cb(err);
185
+ if (n) return cb(null, n, pkg);
186
+ process(dirs.slice(1));
187
188
})(nodeModulesPaths(start, opts));
189
}
190
};
0 commit comments