Skip to content

Commit 03d3067

Browse files
committed
Revert #92, use resolve's preserveSymlinks option
1 parent ed75d00 commit 03d3067

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

index.js

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ function build_resolve_opts(opts, base) {
206206
return opts;
207207
}
208208

209-
function resolve(id, opts, callback) {
209+
function resolve(id, opts, cb) {
210210

211211
// opts.filename
212212
// opts.paths
@@ -216,24 +216,6 @@ function resolve(id, opts, callback) {
216216
opts = opts || {};
217217
opts.filename = opts.filename || '';
218218

219-
var cb = function(err, path, pkg) {
220-
fs.stat(path, function(notPath) {
221-
if (notPath) {
222-
callback(err, path, pkg);
223-
}
224-
else {
225-
fs.realpath(path, function(notReal, real) {
226-
if (notReal) {
227-
callback(err, path, pkg);
228-
}
229-
else {
230-
callback(err, real, pkg);
231-
}
232-
});
233-
}
234-
});
235-
}
236-
237219
var base = path.dirname(opts.filename);
238220

239221
if (opts.basedir) {

test/modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ test('respect symlinks', function (done) {
332332
// - node_modules
333333
// - symlink to x
334334
//
335-
resolve('linked', { paths: [ fixtures_dir + '/linker/node_modules' ] }, function(err, path, pkg) {
335+
resolve('linked', { paths: [ fixtures_dir + '/linker/node_modules' ], preserveSymlinks: false }, function(err, path, pkg) {
336336
assert.ifError(err);
337337
assert.equal(path, require.resolve('./fixtures/linked/index'));
338338
done();

0 commit comments

Comments
 (0)