typedoc
Version: 
Create api documentation for TypeScript projects.
13 lines (12 loc) • 433 B
JavaScript
import ts from "typescript";
export function resolveAliasedSymbol(symbol, checker) {
    const seen = new Set();
    while (ts.SymbolFlags.Alias & symbol.flags) {
        symbol = checker.getAliasedSymbol(symbol);
        // #2438, with declaration files, we might have an aliased symbol which eventually points to itself.
        if (seen.has(symbol))
            return symbol;
        seen.add(symbol);
    }
    return symbol;
}