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

Function fileSystemEntryExists

test/fixtures/snapshot/typescript.js:7437–7459  ·  view source on GitHub ↗
(path, entryKind)

Source from the content-addressed store, hash-verified

7435 return ts.matchFiles(path, extensions, excludes, includes, useCaseSensitiveFileNames, process.cwd(), depth, getAccessibleFileSystemEntries, realpath);
7436 }
7437 function fileSystemEntryExists(path, entryKind) {
7438 // Since the error thrown by fs.statSync isn't used, we can avoid collecting a stack trace to improve
7439 // the CPU time performance.
7440 var originalStackTraceLimit = Error.stackTraceLimit;
7441 Error.stackTraceLimit = 0;
7442 try {
7443 var stat = statSync(path);
7444 if (!stat) {
7445 return false;
7446 }
7447 switch (entryKind) {
7448 case 0 /* FileSystemEntryKind.File */: return stat.isFile();
7449 case 1 /* FileSystemEntryKind.Directory */: return stat.isDirectory();
7450 default: return false;
7451 }
7452 }
7453 catch (e) {
7454 return false;
7455 }
7456 finally {
7457 Error.stackTraceLimit = originalStackTraceLimit;
7458 }
7459 }
7460 function fileExists(path) {
7461 return fileSystemEntryExists(path, 0 /* FileSystemEntryKind.File */);
7462 }

Callers 5

fsWatchFunction · 0.85
fileExistsFunction · 0.85
directoryExistsFunction · 0.85

Calls 3

statSyncFunction · 0.70
isFileMethod · 0.45
isDirectoryMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…