Type Alias $<T, $O>

$: $IsExact<
    $O,
    {
        $else: $IsDistributive<
            $O,
            {
                $else: [T] extends readonly [any[]]
                    ? $ResolveBranch<T, $O, [$Else]>
                    : $ResolveBranch<T, $O, [$Then]>;
                $then: T extends readonly any[]
                    ? $ResolveBranch<T, $O, [$Else]>
                    : $ResolveBranch<T, $O, [$Then]>;
            },
        >;
        $then: $IsDistributive<
            $O,
            {
                $else: [T] extends [readonly any[]]
                    ? number extends T["length"]
                        ? $ResolveBranch<T, $O, [$Else]>
                        : $ResolveBranch<T, $O, [$Then]>
                    : $ResolveBranch<T, $O, [$Then]>;
                $then: T extends readonly any[]
                    ? number extends T["length"]
                        ? $ResolveBranch<T, $O, [$Else]>
                        : $ResolveBranch<T, $O, [$Then]>
                    : $ResolveBranch<T, $O, [$Then]>;
            },
        >;
    },
>

🧰 type util

Validate if T is not an array.

This is a type util for building custom types. It does not check against special types.

Type Parameters