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

dependency-cruiser

Package Overview
Dependencies
Maintainers
1
Versions
536
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-cruiser - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

src/extract/resolve/localNpmHelpers.js

2

package.json
{
"name": "dependency-cruiser",
"version": "2.1.0",
"version": "2.1.1",
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.",

@@ -5,0 +5,0 @@ "bin": {

"use strict";
const resolve = require("resolve");
const getPackageJson = require("./getPackageJson");
const resolve = require("resolve");
const localNpmHelpers = require("./localNpmHelpers");

@@ -13,12 +13,2 @@ const npm2depType = {

function dependencyIsDeprecated(pModule, pBaseDir) {
let lRetval = false;
let lPackageJson = getPackageJson(pModule, pBaseDir);
if (Boolean(lPackageJson)){
lRetval = lPackageJson.hasOwnProperty("deprecated");
}
return lRetval;
}
function determineNpmDependencyTypes(pModuleName, pPackageDeps) {

@@ -40,2 +30,12 @@ let lRetval = ["npm-unknown"];

function dependencyIsDeprecated (pModule, pBaseDir) {
let lRetval = false;
let lPackageJson = localNpmHelpers.getPackageJson(pModule, pBaseDir);
if (Boolean(lPackageJson)){
lRetval = lPackageJson.hasOwnProperty("deprecated");
}
return lRetval;
}
module.exports = (pDependency, pModuleName, pPackageDeps, pBaseDir) => {

@@ -59,4 +59,10 @@ let lRetval = ["undetermined"];

// '/' (if any) - because e.g. 'lodash/fp' is ultimately the 'lodash'
// package
lRetval = determineNpmDependencyTypes(pModuleName.split("/")[0], pPackageDeps);
// package...
//
// unless the package is 'scoped (@organization/coolpackage),
// in which case we'd need it until the second '/'
lRetval = determineNpmDependencyTypes(
localNpmHelpers.getPackageRoot(pModuleName),
pPackageDeps
);

@@ -63,0 +69,0 @@ if (dependencyIsDeprecated(pModuleName, pBaseDir)) {

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