Skip to content

Option for adding undefined to optional union for optional properties. #604

Open
@jeremyjacob

Description

@jeremyjacob

In TypeScript, when exactOptionalPropertyTypes is set to true, properties that are optional?: but not do not include | undefined in their union can not be assigned a value of undefined.

For generating code that will be consumed by others, we may not want to force them to turn off exactOptionalPropertyTypes. For that please consider an option to include undefined in generated type unions of non-required properties.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions