Skip to content

Commit

Permalink
feat(api): support boolean literals
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsdev committed Oct 12, 2022
1 parent 36b4edf commit 190a996
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/api/src/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ function _generateTypeTree({ symbol, type }: SymbolOrType, ctx: TypeTreeContext,
else if(flags & ts.TypeFlags.Never) { return { kind: 'primitive', primitive: 'never' }}
else if(flags & ts.TypeFlags.StringLiteral) { return { kind: 'string_literal', value: (type as ts.StringLiteralType).value }}
else if(flags & ts.TypeFlags.NumberLiteral) { return { kind: 'number_literal', value: (type as ts.NumberLiteralType).value }}
// TODO: boolean literal
// else if(flags & ts.TypeFlags.BooleanLiteral) { return { kind: 'boolean_literal', value: (type as ts.BooleanLiteral).value }}
else if(flags & ts.TypeFlags.BooleanLiteral) { return { kind: 'boolean_literal', value: (type as IntrinsicTypeInternal).intrinsicName === "true" }}
// TODO: enum literal
// else if(flags & ts.TypeFlags.EnumLiteral) { return { kind: 'enum_literal', value: (type as ts.StringLiteralType).value }}
// TODO: add enum info???
Expand Down

0 comments on commit 190a996

Please sign in to comment.