Skip to content

Proposal: is.falsy() as a type guard #146

@younho9

Description

@younho9

Although there are restrictions on using is.truthy() as a type guard function, is.falsy() could be a type guard function.

type Falsy = false | 0 | 0n | '' | null | undefined;

is.falsy = (value: unknown): value is Falsy => !value;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions