Skip to content

ternary operator with an empty object always gives an empty object #14758

@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd
const data = Math.random() > 0.5 ? { value: 1 } : { }; 
// expected data to be {} | { value: number }, actual data is {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions