Skip to content

Checking obj.catch #6

Closed
Closed
@jamiebuilds

Description

@jamiebuilds

Just got caught up using is-promise with a jQuery.Deferred as then is defined but catch is not. Since this is is-promise and not is-thenable I figured it might be a good idea to check catch as well.

return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function' && typeof obj.catch === 'function';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions