From 283c04ca9a68fa2bad623bf4b6ca4bea1c1a7ff5 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Fri, 21 Aug 2020 06:43:34 +0300 Subject: [PATCH] feat: handle complex union types in schematics --- npm/ng-packs/packages/schematics/src/utils/type.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/npm/ng-packs/packages/schematics/src/utils/type.ts b/npm/ng-packs/packages/schematics/src/utils/type.ts index b74cf95313..d6e451f202 100644 --- a/npm/ng-packs/packages/schematics/src/utils/type.ts +++ b/npm/ng-packs/packages/schematics/src/utils/type.ts @@ -36,7 +36,10 @@ export function flattenUnionTypes(types: string[], type: string) { type .replace(/^{/, '') .replace(/}$/, '') + .replace(/{/, '(') + .replace(/}/, ')') .split(':') + .filter(Boolean) .forEach(t => types.push(t)); return types;