MCPcopy Index your code
hub / github.com/nodejs/node / disableCache

Function disableCache

test/fixtures/snapshot/typescript.js:124395–124410  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

124393 };
124394 }
124395 function disableCache(state) {
124396 if (!state.cache)
124397 return;
124398 var cache = state.cache, host = state.host, compilerHost = state.compilerHost, extendedConfigCache = state.extendedConfigCache, moduleResolutionCache = state.moduleResolutionCache, typeReferenceDirectiveResolutionCache = state.typeReferenceDirectiveResolutionCache;
124399 host.readFile = cache.originalReadFile;
124400 host.fileExists = cache.originalFileExists;
124401 host.directoryExists = cache.originalDirectoryExists;
124402 host.createDirectory = cache.originalCreateDirectory;
124403 host.writeFile = cache.originalWriteFile;
124404 compilerHost.getSourceFile = cache.originalGetSourceFile;
124405 state.readFileWithCache = cache.originalReadFileWithCache;
124406 extendedConfigCache.clear();
124407 moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.clear();
124408 typeReferenceDirectiveResolutionCache === null || typeReferenceDirectiveResolutionCache === void 0 ? void 0 : typeReferenceDirectiveResolutionCache.clear();
124409 state.cache = undefined;
124410 }
124411 function clearProjectStatus(state, resolved) {
124412 state.projectStatus.delete(resolved);
124413 state.diagnostics.delete(resolved);

Callers 3

enableCacheFunction · 0.85
buildFunction · 0.85

Calls 1

clearMethod · 0.65

Tested by

no test coverage detected