📄 isSymbolFromDefaultLibrary¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 1 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/type-utils/src/isSymbolFromDefaultLibrary.ts
Functions¶
isSymbolFromDefaultLibrary(program: ts.Program, symbol: ts.Symbol | undefined): boolean¶
Parameters:
programts.Programsymbolts.Symbol | undefined
Returns: boolean
Calls:
symbol.getDeclarationsdeclaration.getSourceFileprogram.isSourceFileDefaultLibrary
Code
export function isSymbolFromDefaultLibrary(
program: ts.Program,
symbol: ts.Symbol | undefined,
): boolean {
if (!symbol) {
return false;
}
const declarations = symbol.getDeclarations() ?? [];
for (const declaration of declarations) {
const sourceFile = declaration.getSourceFile();
if (program.isSourceFileDefaultLibrary(sourceFile)) {
return true;
}
}
return false;
}
Generated by Syntax Scribe