Type alias IsBigint<T, $O>

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

🎭 predicate

Validate if T is bigint or bigint literals.

Type Parameters

Example

type R = IsBigint<bigint> // true
type R = IsBigint<1n> // true

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

type R = IsBigint<string | bigint> // boolean

🔢 customize

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

Example

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

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

type R = IsBigint<string | bigint> // bigint

🔢 customize:

Validate if T is exactly bigint.

Example

type R = IsBigint<bigint, { exact: true }> // true
type R = IsBigint<1n, { exact: true }> // false

🔢 customize:

Disable distribution of union types.

type R = IsBigint<bigint | 1> // boolean
type R = IsBigint<bigint | 1, { distributive: false }> // false

🔢 customize

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

Example

type R = IsBigint<bigint, $SelectionBranch> // $Then
type R = IsBigint<string, $SelectionBranch> // $Else

Generated using TypeDoc