Get the intersection or union type parts of the given type.
Note that this is a shallow collection: it only returns type.types or [type].
type.types
[type]
If the given type is not an intersection or union type, an array contain only that type will be returned.
declare const type: ts.Type;for (const typePart of intersectionTypeParts(type)) { // ...} Copy
declare const type: ts.Type;for (const typePart of intersectionTypeParts(type)) { // ...}
Get the intersection or union type parts of the given type.
Note that this is a shallow collection: it only returns
type.types
or[type]
.If the given type is not an intersection or union type, an array contain only that type will be returned.