Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

resolve

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resolve - npm Package Compare versions

Comparing version 0.1.0 to 0.1.2

test/resolver/other_path/lib/other-lib.js

8

index.js

@@ -27,4 +27,6 @@ var fs = require('fs');

;
if (x.match(/^(?:\.\.?\/|\/)/)) {
opts.paths = opts.paths || [];
if (x.match(/^(?:\.\.?\/|\/|([A-Za-z]:)?\\)/)) {
var m = loadAsFileSync(path.resolve(y, x))

@@ -94,4 +96,4 @@ || loadAsDirectorySync(path.resolve(y, x));

}
return dirs;
return opts.paths.concat(dirs);
}
};
{
"name" : "resolve",
"description" : "A more hookable require.resolve() implementation",
"version" : "0.1.0",
"version" : "0.1.2",
"repository" : {

@@ -6,0 +6,0 @@ "type" : "git",

@@ -117,1 +117,33 @@ var assert = require('assert');

};
exports.other_path = function () {
var resolverDir = __dirname + '/resolver';
var dir = resolverDir + '/bar';
var otherDir = resolverDir + '/other_path';
var path = require('path');
assert.equal(
resolve.sync('root', {
basedir : dir,
paths: [otherDir] }),
resolverDir + '/other_path/root.js'
);
assert.equal(
resolve.sync('lib/other-lib', {
basedir : dir,
paths: [otherDir] }),
resolverDir + '/other_path/lib/other-lib.js'
);
assert.throws(function () {
resolve.sync('root', { basedir : dir, });
});
assert.throws(function () {
resolve.sync('zzz', {
basedir : dir,
paths: [otherDir] });
});
};
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc