Skip to content

Commit

Permalink
Revert #92, use resolve's preserveSymlinks option
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Jun 18, 2020
1 parent 39ddada commit 35a713d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
20 changes: 1 addition & 19 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function build_resolve_opts(opts, base) {
return opts;
}

function resolve(id, opts, callback) {
function resolve(id, opts, cb) {

// opts.filename
// opts.paths
Expand All @@ -216,24 +216,6 @@ function resolve(id, opts, callback) {
opts = opts || {};
opts.filename = opts.filename || '';

var cb = function(err, path, pkg) {
fs.stat(path, function(notPath) {
if (notPath) {
callback(err, path, pkg);
}
else {
fs.realpath(path, function(notReal, real) {
if (notReal) {
callback(err, path, pkg);
}
else {
callback(err, real, pkg);
}
});
}
});
}

var base = path.dirname(opts.filename);

if (opts.basedir) {
Expand Down
2 changes: 1 addition & 1 deletion test/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ test('respect symlinks', function (done) {
// - node_modules
// - symlink to x
//
resolve('linked', { paths: [ fixtures_dir + '/linker/node_modules' ] }, function(err, path, pkg) {
resolve('linked', { paths: [ fixtures_dir + '/linker/node_modules' ], preserveSymlinks: false }, function(err, path, pkg) {
assert.ifError(err);
assert.equal(path, require.resolve('./fixtures/linked/index'));
done();
Expand Down

0 comments on commit 35a713d

Please sign in to comment.