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

Function saveCache

grunt/tasks/javascript.js:75–94  ·  view source on GitHub ↗
(cachePath, basePath, bundleCache)

Source from the content-addressed store, hash-verified

73 };
74
75 const saveCache = async (cachePath, basePath, bundleCache) => {
76 if (!isDisableCache) {
77 cache = bundleCache;
78 }
79 await new Promise((resolve, reject) => {
80 let str = JSON.stringify(bundleCache);
81 // Make cache location agnostic by stripping current basePath
82 str = str.replace(new RegExp(escapeRegExp(basePath), 'g'), '%%basePath%%');
83 deflate(str, { level: constants.Z_BEST_SPEED }, (err, buffer) => {
84 if (err) {
85 console.error('An error occurred saving rollup cache:', err);
86 process.exitCode = 1;
87 reject(err);
88 return;
89 }
90 fs.writeFileSync(cachePath, buffer);
91 resolve();
92 });
93 });
94 };
95
96 const logPrettyError = (err, cachePath, basePath) => {
97 let hasOutput = false;

Callers 2

logPrettyErrorFunction · 0.85
javascript.jsFile · 0.85

Calls 1

escapeRegExpFunction · 0.85

Tested by

no test coverage detected