Skip to content

Commit e377524

Browse files
shlomiassafblakeembrey
authored andcommitted
Fix enum type conversion (TypeStrong#591)
1 parent f7d27e5 commit e377524

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib/converter/types/enum.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class EnumConverter extends ConverterTypeComponent implements TypeTypeCon
1111
* Test whether this converter can handle the given TypeScript type.
1212
*/
1313
supportsType(context: Context, type: ts.Type): boolean {
14-
return !!(type.flags & ts.TypeFlags.Enum);
14+
return !!(type.flags & ts.TypeFlags.EnumLike);
1515
}
1616

1717
/**

src/lib/converter/types/union-or-intersection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class UnionOrIntersectionConverter extends ConverterTypeComponent impleme
1717
* Test whether this converter can handle the given TypeScript type.
1818
*/
1919
supportsType(context: Context, type: ts.UnionOrIntersectionType): boolean {
20-
return !!(type.flags & ts.TypeFlags.UnionOrIntersection);
20+
return !!(type.flags & ts.TypeFlags.UnionOrIntersection) && !(type.flags & ts.TypeFlags.EnumLiteral);
2121
}
2222

2323
/**

0 commit comments

Comments
 (0)