UNPKG

dependency-cruiser-fork

Version:

Validate and visualize dependencies. With your rules. JavaScript, TypeScript, CoffeeScript. ES6, CommonJS, AMD.

17 lines (12 loc) 360 B
const _memoize = require("lodash/memoize"); function bareFindModuleByName(pGraph, pSource) { return pGraph.find((pNode) => pNode.source === pSource); } const findModuleByName = _memoize( bareFindModuleByName, (_pGraph, pSource) => pSource ); module.exports = findModuleByName; module.exports.clearCache = () => { findModuleByName.cache.clear(); };