Skip to content

Additional undefined case inside union type #1929

Open
@iy-work

Description

@iy-work

Question

Why is the instance type for types.union(types.string, types.array(types.number)) inferred as string | (number[] & ...) | undefined? I thought that it should be just string | (number[] & ...) without undefined case. Is this behaviour intended or it is a mistake in typings?

playground link

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion or help request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions