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

Function sourceFileOfTopLevelDeclaration

test/fixtures/snapshot/typescript.js:162574–162576  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

162572 return isNonVariableTopLevelDeclaration(node) && ts.isSourceFile(node.parent) || ts.isVariableDeclaration(node) && ts.isSourceFile(node.parent.parent.parent);
162573 }
162574 function sourceFileOfTopLevelDeclaration(node) {
162575 return ts.isVariableDeclaration(node) ? node.parent.parent.parent : node.parent;
162576 }
162577 function isTopLevelDeclarationStatement(node) {
162578 ts.Debug.assert(ts.isSourceFile(node.parent), "Node parent should be a SourceFile");
162579 return isNonVariableTopLevelDeclaration(node) || ts.isVariableStatement(node);

Callers 1

getUsageInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…