Socket
Socket
Sign inDemoInstall

codependency

Package Overview
Dependencies
1
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 to 0.1.1

53

index.js

@@ -22,11 +22,33 @@ var path = require('path');

if (options.dontThrow || options.optional) {
try {
mod = baseMod.require(name);
} catch (error) {
// ignore error
try {
mod = baseMod.require(name);
} catch (error) {
// deal with non-existence
if (error.code === 'MODULE_NOT_FOUND') {
if (options.optional) {
return;
}
var cmd = 'npm install ' + name;
if (range !== '*') {
cmd += "@'" + range + "'";
}
cmd += ' --save';
throw new Error(
'Module "' + name + '" not found. Please run: ' + cmd
);
}
// there was an error in the module itself
// rethrow it if allowed.
if (options.dontThrow) {
return;
}
} else {
mod = baseMod.require(name);
throw error;
}

@@ -48,4 +70,3 @@

throw new Error(
'Package "' + name + '" has no version information in ' +
pkgPath
'Module "' + name + '" has no version information in ' + pkgPath
);

@@ -60,4 +81,3 @@ }

throw new TypeError(
'Version in package "' + name + '" ' +
'is not a string.'
'Version of module "' + name + '" is not a string.'
);

@@ -72,4 +92,4 @@ }

throw new Error(
'Package "' + name + '" of version ' + pkg.version +
' does not satisfy requirement: ' + range
'Version ' + pkg.version + ' of module "' + name + '" ' +
'does not satisfy requirement: ' + range
);

@@ -146,4 +166,3 @@ }

var sanitised = semver.validRange(range);
if (!sanitised) {
if (!semver.validRange(range)) {
throw new Error(

@@ -155,3 +174,3 @@ 'Version range ' + range + ' of dependency ' +

fullDeps[name] = sanitised;
fullDeps[name] = range;
}

@@ -199,3 +218,3 @@ }

return realRequire(deps, baseModule, name, options || {});
};
}

@@ -202,0 +221,0 @@ if (pkg.name) {

{
"name": "codependency",
"keywords": ["peer", "dependency", "dependencies", "require", "module", "semver"],
"version": "0.1.0",
"version": "0.1.1",
"description": "Optional peer dependencies",

@@ -6,0 +6,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc