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

resolve

Package Overview
Dependencies
Maintainers
2
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 1.3.0 to 1.3.1

5

lib/async.js

@@ -6,3 +6,2 @@ var core = require('./core');

var nodeModulesPaths = require('./node-modules-paths.js');
var format = require('util').format;

@@ -48,3 +47,3 @@ module.exports = function resolve(x, options, callback) {

else {
var moduleError = new Error(format("Cannot find module '%s' from '%s' with extension in %j", x, y, extensions));
var moduleError = new Error("Cannot find module '" + x + "' from '" + y + "'");
moduleError.code = 'MODULE_NOT_FOUND';

@@ -62,3 +61,3 @@ cb(moduleError);

else {
var moduleError = new Error(format("Cannot find module '%s' from '%s' with extension in %j", x, y, extensions));
var moduleError = new Error("Cannot find module '" + x + "' from '" + y + "'");
moduleError.code = 'MODULE_NOT_FOUND';

@@ -65,0 +64,0 @@ cb(moduleError);

3

lib/sync.js

@@ -6,3 +6,2 @@ var core = require('./core');

var nodeModulesPaths = require('./node-modules-paths.js');
var format = require('util').format;

@@ -39,3 +38,3 @@ module.exports = function (x, options) {

var err = new Error(format("Cannot find module '%s' from '%s' with extension in %j", x, y, extensions));
var err = new Error("Cannot find module '" + x + "' from '" + y + "'");
err.code = 'MODULE_NOT_FOUND';

@@ -42,0 +41,0 @@ throw err;

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

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

@@ -36,3 +36,3 @@ var path = require('path');

resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -42,3 +42,3 @@ });

resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -80,3 +80,3 @@ });

resolve('baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module 'baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -86,3 +86,3 @@ });

resolve('../baz', opts('/foo/bar'), function (err, res) {
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module '../baz' from '" + path.resolve('/foo/bar') + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -89,0 +89,0 @@ });

@@ -34,3 +34,3 @@ var path = require('path');

resolve('foo', { basedir: dir }, function (err) {
t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module 'foo' from '" + path.resolve(dir) + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -194,3 +194,3 @@ });

resolve('./cup', { basedir: dir, extensions: ['.js'] }, function (err, res) {
t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module './cup' from '" + path.resolve(dir) + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -236,3 +236,3 @@ });

resolve('root', { basedir: dir }, function (err, res) {
t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module 'root' from '" + path.resolve(dir) + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -242,3 +242,3 @@ });

resolve('zzz', { basedir: dir, paths: [otherDir] }, function (err, res) {
t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "' with extension in [\".js\"]");
t.equal(err.message, "Cannot find module 'zzz' from '" + path.resolve(dir) + "'");
t.equal(err.code, 'MODULE_NOT_FOUND');

@@ -245,0 +245,0 @@ });

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