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

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.

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

🔢 customize

Disable distribution of union types.

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.

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

🔢 customize

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

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