Type Alias IsBigintLiteral<T, $O>

IsBigintLiteral: $Special<
    T,
    $MergeOptions<
        $O,
        { $else: IsBigintLiteral.$<T, $O>; $then: $ResolveBranch<$O, [$Else]> },
    >,
>

🎭 predicate

Validate if T is bigint literals.

Type Parameters

type R = IsBigintLiteral<bigint> // false
type R = IsBigintLiteral<1n> // true

type R = IsBigintLiteral<never> // false
type R = IsBigintLiteral<unknown> // false
type R = IsBigintLiteral<string | boolean> // false

type R = IsBigintLiteral<string | number> // boolean

🔢 customize

Filter to ensure T is bigint literals, otherwise returns never.

type R = IsBigintLiteral<bigint, { selection: 'filter' }> // never
type R = IsBigintLiteral<1n, { selection: 'filter' }> // 1n

type R = IsBigintLiteral<never, { selection: 'filter' }> // never
type R = IsBigintLiteral<unknown, { selection: 'filter' }> // never
type R = IsBigintLiteral<string | boolean, { selection: 'filter' }> // never

type R = IsBigintLiteral<string | number> // number

🔢 customize:

Disable distribution of union types.

type R = IsBigintLiteral<1n | string> // boolean
type R = IsBigintLiteral<1n | string, { distributive: false }> // false

🔢 customize

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

type R = IsBigintLiteral<1n, $SelectionBranch> // $Then
type R = IsBigintLiteral<string, $SelectionBranch> // $Else