MCPcopy Create free account
hub / github.com/nodejs/node / forEachAncestorDirectory

Function forEachAncestorDirectory

test/fixtures/snapshot/typescript.js:8202–8214  ·  view source on GitHub ↗
(directory, callback)

Source from the content-addressed store, hash-verified

8200 }
8201 ts.getRelativePathToDirectoryOrUrl = getRelativePathToDirectoryOrUrl;
8202 function forEachAncestorDirectory(directory, callback) {
8203 while (true) {
8204 var result = callback(directory);
8205 if (result !== undefined) {
8206 return result;
8207 }
8208 var parentPath = getDirectoryPath(directory);
8209 if (parentPath === directory) {
8210 return undefined;
8211 }
8212 directory = parentPath;
8213 }
8214 }
8215 ts.forEachAncestorDirectory = forEachAncestorDirectory;
8216 function isNodeModulesDirectory(dirPath) {
8217 return ts.endsWith(dirPath, "/node_modules");

Callers

nothing calls this directly

Calls 2

getDirectoryPathFunction · 0.85
callbackFunction · 0.70

Tested by

no test coverage detected