This commit is contained in:
Jaco Greeff
2021-02-26 17:39:59 +01:00
committed by GitHub
parent e2545276bb
commit c37a2fc756
5 changed files with 19 additions and 21 deletions
+2 -2
View File
@@ -70,8 +70,8 @@ export function setImports (allDefs: Record<string, ModuleTypes>, imports: TypeI
setImports(allDefs, imports, [typeDef.sub.type]);
}
} else if (type.includes('[') && type.includes('|')) {
// We split the types
const splitTypes = /\[\s?(.+?)\s?\]/.exec(type)![1].split(/\s?\|\s?/);
// We split the types (we already dod the check above, so safe-path should not be caught)
const splitTypes = (/\[\s?(.+?)\s?\]/.exec(type) || ['', ''])[1].split(/\s?\|\s?/);
setImports(allDefs, imports, splitTypes);
} else {