Skip to main content
Module

x/unknownutil/is.ts>isBigInt

🦕 A lightweight utility pack for handling unknown type
Go to Latest
function isBigInt
import { isBigInt } from "https://deno.land/x/unknownutil@v3.18.0/is.ts";

Return true if the type of x is bigint.

import { is } from "@core/unknownutil";

const a: unknown = 0n;
if (is.BigInt(a)) {
  // a is narrowed to bigint
  const _: bigint = a;
}

Parameters

x: unknown

Returns

x is bigint