Skip to content

Commit

Permalink
fix: Tuples could cause a crash
Browse files Browse the repository at this point in the history
Semi-fix for #1439. Really need a test case.
  • Loading branch information
Gerrit0 committed Jan 1, 2021
1 parent c9796fc commit b4da1ca
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/converter/types.ts
Expand Up @@ -809,7 +809,9 @@ const tupleConverter: TypeConverter<ts.TupleTypeNode, ts.TupleType> = {
convertType(context, type)
);

if (node.elements.every(ts.isNamedTupleMember)) {
// TODO: TS apparently lies about this... GH1439.
// Unfortunately, I can't seem to reproduce this. Needs a test case.
if (node.elements && node.elements.every(ts.isNamedTupleMember)) {
const namedMembers = node.elements as readonly ts.NamedTupleMember[];
elements = elements?.map(
(el, i) =>
Expand Down

0 comments on commit b4da1ca

Please sign in to comment.