dependency-cruiser
Advanced tools
Comparing version 2.1.0 to 2.1.1
{ | ||
"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)) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
128899
2250