MCPcopy Index your code
hub / github.com/adaptlearning/adapt_framework / checkCache

Function checkCache

grunt/tasks/javascript.js:45–73  ·  view source on GitHub ↗
(invalidate)

Source from the content-addressed store, hash-verified

43 };
44
45 const checkCache = function(invalidate) {
46 if (!cache) return;
47 const idHash = {};
48 const missing = {};
49 cache.modules.forEach(mod => {
50 const moduleId = mod.id;
51 const isRollupHelper = (moduleId[0] === '\u0000');
52 if (isRollupHelper) {
53 // Ignore as injected rollup module
54 return null;
55 }
56 if (!fs.existsSync(moduleId)) {
57 grunt.log.error(`Cache missing file: ${moduleId.replace(cwd, '')}`);
58 missing[moduleId] = true;
59 return false;
60 }
61 if (invalidate && invalidate.includes(moduleId)) {
62 grunt.log.ok(`Cache skipping file: ${moduleId.replace(cwd, '')}`);
63 return false;
64 }
65 idHash[moduleId] = mod;
66 return true;
67 });
68 if (Object.keys(missing).length) {
69 cache = null;
70 return;
71 }
72 cache.modules = Object.values(idHash);
73 };
74
75 const saveCache = async (cachePath, basePath, bundleCache) => {
76 if (!isDisableCache) {

Callers 1

javascript.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected