From 2e323ac9f45fa9f68c624327f4c2e9dfa986ccbc Mon Sep 17 00:00:00 2001 From: "Shlomi Assaf (shlassaf)" Date: Mon, 11 Sep 2017 04:04:59 +0300 Subject: [PATCH] fix wrong enum type convertion --- src/lib/converter/types/enum.ts | 2 +- src/lib/converter/types/union-or-intersection.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/converter/types/enum.ts b/src/lib/converter/types/enum.ts index cfb688f2f..f2d79c513 100644 --- a/src/lib/converter/types/enum.ts +++ b/src/lib/converter/types/enum.ts @@ -11,7 +11,7 @@ export class EnumConverter extends ConverterTypeComponent implements TypeTypeCon * Test whether this converter can handle the given TypeScript type. */ supportsType(context: Context, type: ts.Type): boolean { - return !!(type.flags & ts.TypeFlags.Enum); + return !!(type.flags & ts.TypeFlags.EnumLike); } /** diff --git a/src/lib/converter/types/union-or-intersection.ts b/src/lib/converter/types/union-or-intersection.ts index 444341cfd..e9e256b7d 100644 --- a/src/lib/converter/types/union-or-intersection.ts +++ b/src/lib/converter/types/union-or-intersection.ts @@ -17,7 +17,7 @@ export class UnionOrIntersectionConverter extends ConverterTypeComponent impleme * Test whether this converter can handle the given TypeScript type. */ supportsType(context: Context, type: ts.UnionOrIntersectionType): boolean { - return !!(type.flags & ts.TypeFlags.UnionOrIntersection); + return !!(type.flags & ts.TypeFlags.UnionOrIntersection) && !(type.flags & ts.TypeFlags.EnumLiteral); } /**