Skip to content

Should transform "x ? true : false" into "!!x" and "x ? false : true" into "!x" #4270

@TomasRiker

Description

@TomasRiker

With the latest release (v20250820):

window.f = x => x ? true : false;

gets transformed into

window.f=a=>a?!0:!1;

A shorter (and to my knowledge, equivalent) expression would be:

window.f=a=>!!a;

Similarly,

window.f = x => x ? false : true;

should be transformed into

window.f=a=>!a;

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions