JezK
Edit File: cache-group.js.map
{"version":3,"file":"cache-group.js","sourceRoot":"","sources":["../src/cache-group.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,iCAAkC;AA2ClC,iBAAS,MAAM,UAAU;IAKvB;QAJA,iBAAY,GAAG,IAAI,KAAK,EAAE,CAAC;QAC3B,SAAI,GAAG,IAAI,KAAK,EAAE,CAAC;QACnB,mBAAc,GAAG,IAAI,KAAK,EAAE,CAAC;QAC7B,wBAAmB,GAAG,IAAI,KAAK,EAAE,CAAC;QAEhC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC;CACF,CAAC","sourcesContent":["'use strict';\n\nimport Cache = require('./cache');\n\n/*\n * CacheGroup is used to both speed up and ensure consistency of hashForDep.\n *\n * The CacheGroup contains three separate caches:\n *\n * - MODULE_ENTRY: the cache of realPathKey => ModuleEntry objects.\n * Each ModuleEntry contains information about a particular module\n * found during hash-for-dep processing. realPathKey is a hash\n * of the resolved real path to the module's package.json file.\n *\n * Having the real path means that when resolving dependencies, we can\n * take the resolved paths, hash them and check quickly for cache entries,\n * speeding creation of the cache. Because many modules may refer to\n * the same module as a dependency, this eliminates duplication and having\n * to reread package.json files.\n *\n * However, that also means we need a second cache to map from the original\n * name and dir passed to hashForDep to the final resolved path for the\n * module's package.json file.\n *\n * - PATH: the cache of nameDirKey => realPathKey. nameDirKey is a hash of the\n * combination of the name and starting directory passed to hashForDep.\n * realPathKey is a hash of the resulting real path to the relevant package.json file.\n *\n * - REAL_FILE_PATH: the cache of filePath => resolved realPath for relevant files.\n * When determining the location of a file, the file path may involve links.\n * This cache is keyed on the original file path, with a value of the real path.\n * This cache helps to speed up path resolution in both cases by minimizing\n * the use of costly 'fs.statSync' calls.\n *\n * - REAL_DIRECTORY_PATH: the cache of filePath => resolved realPath for relevant directories.\n * When determining the location of a file by going up the node_modules chain,\n * paths to intervening directories may contain links. Similar to REAL_FILE_PATH,\n * this cache is keyed on the original directory path, with a value of the real path.\n * This cache helps to speed up path resolution in both cases by minimizing\n * the use of costly 'fs.statSync' calls.\n *\n * Note: when discussing 'real paths' above, the paths are normalized by routines\n * like path.join() or path.resolve(). We do nothing beyond that (e.g., we do not attempt\n * to force the paths into POSIX style.)\n */\nexport = class CacheGroup {\n MODULE_ENTRY = new Cache();\n PATH = new Cache();\n REAL_FILE_PATH = new Cache();\n REAL_DIRECTORY_PATH = new Cache();\n constructor() {\n Object.freeze(this);\n }\n};\n"]}