dependency-cruiser
Version:
Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.
21 lines (17 loc) • 483 B
JavaScript
;
const isModuleOnlyRule = require('./isModuleOnlyRule');
function match(pModule){
return pRule => (
pModule.orphan === true &&
pRule.from.orphan === true
) && (!pRule.from.path ||
pModule.source.match(pRule.from.path)
) && (!pRule.from.pathNot ||
!(pModule.source.match(pRule.from.pathNot))
);
}
const isInteresting = pRule => isModuleOnlyRule(pRule);
module.exports = {
match,
isInteresting
};