mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-22 12:03:44 -05:00
getAllPossiblePropertiesOfTypes: Skip primitives
This commit is contained in:
@@ -5785,6 +5785,10 @@ namespace ts {
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
const props = createMap<Symbol>();
|
||||
for (const memberType of (type as UnionType).types) {
|
||||
if (memberType.flags & TypeFlags.Primitive) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const { name } of getPropertiesOfType(memberType)) {
|
||||
if (!props.has(name)) {
|
||||
props.set(name, createUnionOrIntersectionProperty(type as UnionType, name));
|
||||
|
||||
@@ -2587,6 +2587,7 @@ namespace ts {
|
||||
/**
|
||||
* For a union, will include a property if it's defined in *any* of the member types.
|
||||
* So for `{ a } | { b }`, this will include both `a` and `b`.
|
||||
* Does not include properties of primitive types.
|
||||
*/
|
||||
/* @internal */ getAllPossiblePropertiesOfType(type: Type): Symbol[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user