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

Function createDirectoryWatcher

test/fixtures/snapshot/typescript.js:6387–6406  ·  view source on GitHub ↗
(dirName, dirPath, fallbackOptions)

Source from the content-addressed store, hash-verified

6385 };
6386 }
6387 function createDirectoryWatcher(dirName, dirPath, fallbackOptions) {
6388 var watcher = fsWatch(dirName, 1 /* FileSystemEntryKind.Directory */, function (_eventName, relativeFileName) {
6389 // When files are deleted from disk, the triggered "rename" event would have a relativefileName of "undefined"
6390 if (!ts.isString(relativeFileName))
6391 return;
6392 var fileName = ts.getNormalizedAbsolutePath(relativeFileName, dirName);
6393 // Some applications save a working file via rename operations
6394 var callbacks = fileName && fileWatcherCallbacks.get(toCanonicalName(fileName));
6395 if (callbacks) {
6396 for (var _i = 0, callbacks_1 = callbacks; _i < callbacks_1.length; _i++) {
6397 var fileCallback = callbacks_1[_i];
6398 fileCallback(fileName, FileWatcherEventKind.Changed);
6399 }
6400 }
6401 },
6402 /*recursive*/ false, PollingInterval.Medium, fallbackOptions);
6403 watcher.referenceCount = 0;
6404 dirWatchers.set(dirPath, watcher);
6405 return watcher;
6406 }
6407 }
6408 function createFixedChunkSizePollingWatchFile(host) {
6409 var watchedFiles = [];

Calls 13

fsWatchFunction · 0.85
watchDirectoryFunction · 0.85
isIgnoredPathFunction · 0.85
invokeCallbacksFunction · 0.85
updateChildWatchesFunction · 0.85
getMethod · 0.65
addMethod · 0.65
deleteMethod · 0.65
forEachMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…