Type alias IsNotArray<T, $O>

IsNotArray<T, $O>: $SpecialType<T, $MergeOptions<$O, {
    $else: IsNotArray.$<T, $O>;
    $then: $ResolveBranch<T, $O, [$Then]>;
}>>

🎭 predicate

Validate that T is not an array.

Type Parameters

Example

type R = IsNotArray<number[]> // false
type R = IsNotArray<[1]> // false

type R = IsNotArray<number> // true

🔢 customize

Filter to ensure T is not an array, otherwise returns never.

Example

type R = IsNotArray<number[], { selection: 'filter' }> // never
type R = IsNotArray<number, { selection: 'filter' }> // number

🔢 customize

Disable distribution of union types.

Example

type R = IsNotArray<number[] | 1> // boolean
type R = IsNotArray<number[] | 1, { distributive: false }> // true

🔢 customize

Check if T is not exactly an array, including tuple.

Example

type R = IsNotArray<[]> // false
type R = IsNotArray<[], { exact: true }> // true

🔢 customize

Use unique branch identifiers to allow precise processing of the result.

Example

type R = IsNotArray<number[], IsNotArray.$Branch> // $Else
type R = IsNotArray<number, IsNotArray.$Branch> // $Then

Generated using TypeDoc