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

enhanced-resolve

Package Overview
Dependencies
Maintainers
1
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

enhanced-resolve - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

test/errors.js

33

lib/resolve.js

@@ -282,3 +282,5 @@ /*

}
return callback(new Error("Non of this files exists: " + tries.join(", ")));
var notFoundErr = new Error("Non of this files exists: " + tries.join(", "));
notFoundErr.notImportant = true;
return callback(notFoundErr);
}

@@ -292,3 +294,5 @@ });

if(err || !stats || !stats.isDirectory()) {
return callback(new Error(dirname + " is not a directory"));
var notFoundErr = new Error(dirname + " is not a directory");
notFoundErr.notImportant = true;
return callback(notFoundErr);
}

@@ -301,6 +305,11 @@ var packageJsonFile = join(split(dirname), ["package.json"]);

if(err) {
err.notImportant = true;
callback(err);
return;
}
content = JSON.parse(content);
try {
content = JSON.parse(content);
} catch (jsonError) {
return callback(jsonError);
}
var packageMains = type === "loader" ? options.loaderPackageMains : options.packageMains;

@@ -317,4 +326,5 @@ for(var i = 0; i < packageMains.length; i++) {

loadAsFile(join(split(dirname), [mainModule, "index"]), options, type, sync, function(err2, absoluteFilename) {
if(err2) return callback(err);
return callback(null, absoluteFilename);
if(!err2) return callback(null, absoluteFilename);
err.notImportant = true;
return callback(err);
})

@@ -335,5 +345,5 @@ });

loadAsFile(pathname, options, type, sync, function loadAsFileOrDirectoryFileResultCallback(err, absoluteFilename) {
if(err)
error = err;
else {
if(err) {
if(!err.notImportant || !error) error = err;
} else {
fastExit = true;

@@ -346,3 +356,3 @@ return callback(null, absoluteFilename);

if(err) {
if(!error) error = err;
if(!error || (error.notImportant && !err.notImportant)) error = err;
} else {

@@ -363,2 +373,3 @@ result = absoluteFilename;

function loadNodeModules(context, identifier, options, type, sync, callback) {
var firstError = null;
var moduleName = identifier.shift();

@@ -377,3 +388,3 @@ var postfixes = type === "loader" ? options.loaderPostfixes : options.postfixes;

}, function() {
callback(new Error("non in any path of paths"));
callback(firstError || new Error("non in any path of paths"));
});

@@ -393,2 +404,3 @@ });

(sync?statSync:statAsync)(pathname, function(err, stat) {
if(err && !firstError) firstError = err;
results[idx] = (err || !stat.isDirectory()) ? null : pathname;

@@ -399,2 +411,3 @@ endOne(idx);

loadAsFileOrDirectory(pathname, options, type, sync, function loadAsFileOrDirectoryCallback(err, absoluteFilename) {
if(err && !firstError) firstError = err;
results[idx] = err ? null : absoluteFilename;

@@ -401,0 +414,0 @@ endOne(idx);

{
"name": "enhanced-resolve",
"version": "0.3.0",
"version": "0.3.1",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "Offers a async require.resolve function. It's highly configurable.",

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