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

Function invokeCallbacks

test/fixtures/snapshot/typescript.js:6574–6611  ·  view source on GitHub ↗
(dirPath, fileNameOrInvokeMap, fileNames)

Source from the content-addressed store, hash-verified

6572 };
6573 }
6574 function invokeCallbacks(dirPath, fileNameOrInvokeMap, fileNames) {
6575 var fileName;
6576 var invokeMap;
6577 if (ts.isString(fileNameOrInvokeMap)) {
6578 fileName = fileNameOrInvokeMap;
6579 }
6580 else {
6581 invokeMap = fileNameOrInvokeMap;
6582 }
6583 // Call the actual callback
6584 callbackCache.forEach(function (callbacks, rootDirName) {
6585 var _a;
6586 if (invokeMap && invokeMap.get(rootDirName) === true)
6587 return;
6588 if (rootDirName === dirPath || (ts.startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === ts.directorySeparator)) {
6589 if (invokeMap) {
6590 if (fileNames) {
6591 var existing = invokeMap.get(rootDirName);
6592 if (existing) {
6593 (_a = existing).push.apply(_a, fileNames);
6594 }
6595 else {
6596 invokeMap.set(rootDirName, fileNames.slice());
6597 }
6598 }
6599 else {
6600 invokeMap.set(rootDirName, true);
6601 }
6602 }
6603 else {
6604 callbacks.forEach(function (_a) {
6605 var callback = _a.callback;
6606 return callback(fileName);
6607 });
6608 }
6609 }
6610 });
6611 }
6612 function nonSyncUpdateChildWatches(dirName, dirPath, fileName, options) {
6613 // Iterate through existing children and update the watches if needed
6614 var parentWatcher = cache.get(dirPath);

Callers 3

createDirectoryWatcherFunction · 0.85

Calls 6

callbackFunction · 0.70
forEachMethod · 0.65
getMethod · 0.65
sliceMethod · 0.65
applyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…