Socket
Socket
Sign inDemoInstall

resolve

Package Overview
Dependencies
8
Maintainers
2
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.18.1 to 1.19.0

.github/workflows/node-4+.yml

3

lib/async.js

@@ -76,2 +76,3 @@ var fs = require('fs');

var extensions = opts.extensions || ['.js'];
var includeCoreModules = opts.includeCoreModules !== false;
var basedir = opts.basedir || path.dirname(caller());

@@ -103,3 +104,3 @@ var parent = opts.filename || basedir;

} else loadAsFile(res, opts.package, onfile);
} else if (isCore(x)) {
} else if (includeCoreModules && isCore(x)) {
return cb(null, x);

@@ -106,0 +107,0 @@ } else loadNodeModules(x, basedir, function (err, n, pkg) {

@@ -15,2 +15,3 @@ {

"dgram": true,
"diagnostics_channel": ">= 15.1",
"dns": true,

@@ -17,0 +18,0 @@ "dns/promises": ">= 15",

@@ -69,2 +69,3 @@ var isCore = require('is-core-module');

var extensions = opts.extensions || ['.js'];
var includeCoreModules = opts.includeCoreModules !== false;
var basedir = opts.basedir || path.dirname(caller());

@@ -83,3 +84,3 @@ var parent = opts.filename || basedir;

if (m) return maybeRealpathSync(realpathSync, m, opts);
} else if (isCore(x)) {
} else if (includeCoreModules && isCore(x)) {
return x;

@@ -86,0 +87,0 @@ } else {

{
"name": "resolve",
"description": "resolve like require.resolve() on behalf of files asynchronously and synchronously",
"version": "1.18.1",
"version": "1.19.0",
"repository": {

@@ -30,5 +30,5 @@ "type": "git",

"array.prototype.map": "^1.0.2",
"aud": "^1.1.2",
"aud": "^1.1.3",
"eclint": "^2.8.1",
"eslint": "^7.11.0",
"eslint": "^7.13.0",
"object-keys": "^1.1.1",

@@ -49,5 +49,5 @@ "safe-publish-latest": "^1.1.4",

"dependencies": {
"is-core-module": "^2.0.0",
"is-core-module": "^2.1.0",
"path-parse": "^1.0.6"
}
}

@@ -39,1 +39,17 @@ var test = require('tape');

test('shadowed core modules return shadow with `includeCoreModules: false`', function (t) {
t.plan(2);
resolve('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }, function (err, res) {
t.ifError(err);
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
});
test('shadowed core modules return shadow with `includeCoreModules: false` [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false });
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc