Skip to content

⬅️ Back to Table of Contents

📄 getSourceFileOfNode

📊 Analysis Summary

Metric Count
🔧 Functions 1

📚 Table of Contents

🛠️ File Location:

📂 packages/type-utils/src/getSourceFileOfNode.ts

Functions

getSourceFileOfNode(node: ts.Node): ts.SourceFile

⚠️ DEPRECATED: Gets the source file for a given node

Raw JSDoc
/**
 * @deprecated
 * Gets the source file for a given node
 */
Code
export function getSourceFileOfNode(node: ts.Node): ts.SourceFile {
  while (node.kind !== ts.SyntaxKind.SourceFile) {
    node = node.parent;
  }
  return node as ts.SourceFile;
}

Generated by Syntax Scribe