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

Function createCachedFileSystemEntries

test/fixtures/snapshot/typescript.js:115239–115256  ·  view source on GitHub ↗
(rootDir, rootDirPath)

Source from the content-addressed store, hash-verified

115237 return ts.getBaseFileName(ts.normalizePath(fileName));
115238 }
115239 function createCachedFileSystemEntries(rootDir, rootDirPath) {
115240 var _a;
115241 if (!host.realpath || ts.ensureTrailingDirectorySeparator(toPath(host.realpath(rootDir))) === rootDirPath) {
115242 var resultFromHost = {
115243 files: ts.map(host.readDirectory(rootDir, /*extensions*/ undefined, /*exclude*/ undefined, /*include*/ ["*.*"]), getBaseNameOfFileName) || [],
115244 directories: host.getDirectories(rootDir) || []
115245 };
115246 cachedReadDirectoryResult.set(ts.ensureTrailingDirectorySeparator(rootDirPath), resultFromHost);
115247 return resultFromHost;
115248 }
115249 // If the directory is symlink do not cache the result
115250 if ((_a = host.directoryExists) === null || _a === void 0 ? void 0 : _a.call(host, rootDir)) {
115251 cachedReadDirectoryResult.set(rootDirPath, false);
115252 return false;
115253 }
115254 // Non existing directory
115255 return undefined;
115256 }
115257 /**
115258 * If the readDirectory result was already cached, it returns that
115259 * Otherwise gets result from host and caches it.

Callers 1

tryReadDirectoryFunction · 0.85

Calls 5

toPathFunction · 0.85
mapMethod · 0.65
realpathMethod · 0.45
setMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…