dependency-cruiser
Advanced tools
Comparing version 1.15.0 to 1.15.1
{ | ||
"name": "dependency-cruiser", | ||
"version": "1.15.0", | ||
"version": "1.15.1", | ||
"description": "Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.", | ||
@@ -37,3 +37,3 @@ "bin": { | ||
"chai-json-schema": "1.4.0", | ||
"eslint": "3.12.2", | ||
"eslint": "3.13.0", | ||
"eslint-plugin-security": "1.2.0", | ||
@@ -57,3 +57,3 @@ "intercept-stdout": "0.1.2", | ||
"acorn": "4.0.4", | ||
"ajv": "4.10.3", | ||
"ajv": "4.10.4", | ||
"chalk": "1.1.3", | ||
@@ -60,0 +60,0 @@ "coffee-script": "1.12.2", |
@@ -8,3 +8,3 @@ # Dependency cruiser ![Dependency cruiser](https://raw.githubusercontent.com/sverweij/dependency-cruiser/master/doc/assets/ZKH-Dependency-recolored-160.png) | ||
- Run through the dependencies in any JavaScript, TypeScript or CoffeeScript project and ... | ||
- ... **validate** them against (your own) [rules](./doc/rules.md) | ||
- ... **validate** them against (your own) [rules](./doc/rules-reference.md) | ||
- ... **report** violated rules | ||
@@ -63,4 +63,4 @@ - in text (for your builds) | ||
- To read more about writing rules check the | ||
[writing rules](./doc/rules.md) | ||
section. | ||
[writing rules](./doc/rules-tutorial.md) tutorial | ||
or the [rules reference](./doc/rules-reference.md) | ||
- There is practical rules configuration to get you started | ||
@@ -97,3 +97,4 @@ [here](./doc/rules.starter.json) | ||
- [Command line reference](./doc/cli.md) | ||
- [Writing rules](./doc/rules.md) | ||
- [Writing rules](./doc/rules-tutorial.md) | ||
- [Rules reference](./doc/rules-reference.md) | ||
- [Real world show cases](./doc/real-world-samples.md) | ||
@@ -100,0 +101,0 @@ - [Output format](./doc/output-format.md) |
@@ -35,4 +35,4 @@ "use strict"; | ||
function extractGroup(pRule, pActualPath) { | ||
let lRetval = null; | ||
function extractGroups(pRule, pActualPath) { | ||
let lRetval = []; | ||
@@ -43,3 +43,3 @@ if (Boolean(pRule.path)) { | ||
if (Boolean(lMatchResult) && lMatchResult.length > 1) { | ||
lRetval = lMatchResult[1]; | ||
lRetval = lMatchResult; | ||
} | ||
@@ -50,5 +50,12 @@ } | ||
function replaceGroupPlaceholders(pString, pExtractedGroups) { | ||
return pExtractedGroups.reduce( | ||
(pAll, pThis, pIndex) => pAll.replace(`$${pIndex}`, pThis), | ||
pString | ||
); | ||
} | ||
function matchRule(pFrom, pTo) { | ||
return pRule => { | ||
const lGroup = extractGroup(pRule.from, pFrom); | ||
const lGroups = extractGroups(pRule.from, pFrom); | ||
@@ -65,9 +72,9 @@ /* | ||
) && (!Boolean(pRule.to.path) || | ||
(Boolean(lGroup) | ||
? pTo.resolved.match(pRule.to.path.replace("$1", lGroup)) | ||
(lGroups.length > 0 | ||
? pTo.resolved.match(replaceGroupPlaceholders(pRule.to.path, lGroups)) | ||
: pTo.resolved.match(pRule.to.path)) | ||
) && (!Boolean(pRule.to.pathNot) || | ||
!( | ||
(Boolean(lGroup) | ||
? pTo.resolved.match(pRule.to.pathNot.replace("$1", lGroup)) | ||
(lGroups.length > 0 | ||
? pTo.resolved.match(replaceGroupPlaceholders(pRule.to.pathNot, lGroups)) | ||
: pTo.resolved.match(pRule.to.pathNot)) | ||
@@ -74,0 +81,0 @@ ) |
Sorry, the diff of this file is not supported yet
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
118
120532
56
2067
+ Addedajv@4.10.4(transitive)
- Removedajv@4.10.3(transitive)
Updatedajv@4.10.4