Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: support bun #1737

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/NodeParser/TypeReferenceNodeParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@
if (typeSymbol.flags & ts.SymbolFlags.Alias) {
const aliasedSymbol = this.typeChecker.getAliasedSymbol(typeSymbol);

return this.childNodeParser.createType(
aliasedSymbol.declarations!.filter((n: ts.Declaration) => !invalidTypes[n.kind])[0],
this.createSubContext(node, context)
);
const declaration = aliasedSymbol.declarations?.filter((n: ts.Declaration) => !invalidTypes[n.kind])[0];

if (!declaration) {
// NB: fallback that happens in bun
domoritz marked this conversation as resolved.
Show resolved Hide resolved
return new AnyType();
}

return this.childNodeParser.createType(declaration, this.createSubContext(node, context));

Check warning on line 46 in src/NodeParser/TypeReferenceNodeParser.ts

View check run for this annotation

Codecov / codecov/patch

src/NodeParser/TypeReferenceNodeParser.ts#L46

Added line #L46 was not covered by tests
}

if (typeSymbol.flags & ts.SymbolFlags.TypeParameter) {
Expand Down