Skip to content

Commit dd50615

Browse files
committed
[Refactor] async: remove unnecessary slashes, since path.join adds them.
1 parent af9a885 commit dd50615

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/async.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ module.exports = function resolve(x, options, callback) {
126126
fpkg = opts.package;
127127
}
128128

129-
var pkgfile = path.join(x, '/package.json');
129+
var pkgfile = path.join(x, 'package.json');
130130
isFile(pkgfile, function (err, ex) {
131131
if (err) return cb(err);
132-
if (!ex) return loadAsFile(path.join(x, '/index'), fpkg, cb);
132+
if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);
133133

134134
readFile(pkgfile, function (err, body) {
135135
if (err) return cb(err);
@@ -148,13 +148,13 @@ module.exports = function resolve(x, options, callback) {
148148
loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
149149
if (err) return cb(err);
150150
if (m) return cb(null, m, pkg);
151-
if (!pkg) return loadAsFile(path.join(x, '/index'), pkg, cb);
151+
if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);
152152

153153
var dir = path.resolve(x, pkg.main);
154154
loadAsDirectory(dir, pkg, function (err, n, pkg) {
155155
if (err) return cb(err);
156156
if (n) return cb(null, n, pkg);
157-
loadAsFile(path.join(x, '/index'), pkg, cb);
157+
loadAsFile(path.join(x, 'index'), pkg, cb);
158158
});
159159
});
160160
return;
@@ -169,13 +169,13 @@ module.exports = function resolve(x, options, callback) {
169169
if (dirs.length === 0) return cb(null, undefined);
170170
var dir = dirs[0];
171171

172-
var file = path.join(dir, '/', x);
172+
var file = path.join(dir, x);
173173
loadAsFile(file, undefined, onfile);
174174

175175
function onfile(err, m, pkg) {
176176
if (err) return cb(err);
177177
if (m) return cb(null, m, pkg);
178-
loadAsDirectory(path.join(dir, '/', x), undefined, ondir);
178+
loadAsDirectory(path.join(dir, x), undefined, ondir);
179179
}
180180

181181
function ondir(err, n, pkg) {

0 commit comments

Comments
 (0)