dependency-cruiser
Advanced tools
Comparing version 1.9.3 to 1.10.0
{ | ||
"name": "dependency-cruiser", | ||
"version": "1.9.3", | ||
"version": "1.10.0", | ||
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.", | ||
@@ -5,0 +5,0 @@ "bin": { |
"use strict"; | ||
const path = require("path"); | ||
function propertyEquals(pTo, pRule, pProperty) { | ||
@@ -9,2 +11,7 @@ return pRule.to.hasOwnProperty(pProperty) | ||
function matchesOwnFolder(pFrom, pTo, pOwnFolder) { | ||
return pOwnFolder ? path.dirname(pFrom) === path.dirname(pTo.resolved) | ||
: path.dirname(pFrom) !== path.dirname(pTo.resolved); | ||
} | ||
function matchRule(pFrom, pTo) { | ||
@@ -16,2 +23,3 @@ return pRule => | ||
(!Boolean(pRule.to.pathNot) || !(pTo.resolved.match(pRule.to.pathNot))) && | ||
(!pRule.to.hasOwnProperty("ownFolder") || matchesOwnFolder(pFrom, pTo, pRule.to.ownFolder)) && | ||
propertyEquals(pTo, pRule, "coreModule") && | ||
@@ -18,0 +26,0 @@ propertyEquals(pTo, pRule, "couldNotResolve"); |
@@ -97,2 +97,6 @@ { | ||
"description": "Whether or not to match modules dependency-cruiser could not resolve (and probably aren't on disk). For this one too: leave out if you don't care either way." | ||
}, | ||
"ownFolder": { | ||
"type": "boolean", | ||
"description": "Whether or not to match modules in the same folder as the 'from'." | ||
} | ||
@@ -99,0 +103,0 @@ } |
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
431793
1878