Type alias Some<A, Criteria, Mode, Then, Else>

Some<A, Criteria, Mode, Then, Else>: Mode extends "strict"
    ? Strict<A, Criteria, Then, Else>
    : Loose<A, Criteria, Then, Else>

Determines whether the array type A contains any elements that satisfies the specified Criteria type.

It operates in loose mode by default, which means literal types satisfies their widened counterparts.

You can also change it to strict mode.

🦴 utilities

Type Parameters

  • A extends readonly unknown[]

  • Criteria

  • Mode extends "strict" | "loose" = "loose"

  • Then = true

  • Else = false

Example

Some<string[], string> // true
Some<['a', boolean], boolean> // true
Some<['a', true], boolean> //true

Some<['a', true], boolean, 'strict'> // false

Generated using TypeDoc