Skip to content

assertTypeBigInt

Asserts that a value is a bigint, with type-narrowing.

import { assertTypeBigInt } from "@kensio/smartass";
const value: unknown = 1n;
assertTypeBigInt(value);
// value is now narrowed to bigint

Source file: src/assert/type-bigint/type-bigint.assert.ts