Skip to content

Add an "argument is not type" operator #16812

Closed
@Arlen22

Description

@Arlen22

We already have:

function isNotUndefined(obj:any): obj is string | number | boolean | MyCustomType | null | MyOtherCustomType {
    return typeof obj !== "undefined";
}

Now we just need:

function isNotUndefined(obj:any): obj is not undefined { // or isnot
    return typeof obj !== "undefined";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions