Skip to content

bigint

Validates bigint while preserving native precision. DDataParser.bigint() handles optional coercion (BigInt(value)) and accepts checkers like min, max, or refine.

Interactive example

Parameters

  • errorMessage: custom message if the value is not a valid bigint.
  • checkers: checkerBigIntMin, checkerBigIntMax, checkerRefine.
  • coerce: true to convert from string / number via BigInt. Defaults to false.

Return value

A DataParserBigInt with the full API (parse, asyncParse, exec, asyncExec, addChecker, clone). schema.parse(data)DEither.success<bigint> or DEither.error<DataParserError>.

Other examples

Custom checkers

Extended mode

See also

  • number - Parser for numbers
  • coerce.* - Coercion functions for various types

Released under the MIT license.