Skip to content

Improve type guard for .all #81

Open
@sindresorhus

Description

@sindresorhus

Issuehunt badges

It would be nice if this worked:

const a = foo();
const b = bar();

// Both `a` and `b` is an `object`, but TS only knows they're `any`.

if (is.all(is.object, a, b)) {
	// `a` and `b` is now known by TS as `object`
}

There is a $30.00 open bounty on this issue. Add more on Issuehunt.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions