Hyperlinkv0.8.0-beta.28

SchemaAST

SchemaAST.BigIntclasseffect/SchemaAST.ts:1529
BigInt

AST node matching any bigint value.

Details

When serialized to a string-based codec, bigints are converted to/from their decimal string representation.

export class BigInt extends Base {
  readonly _tag = "BigInt"
  /** @internal */
  getParser() {
    return fromRefinement(this, Predicate.isBigInt)
  }
  /** @internal */
  matchPart(s: string, options: ParseOptions): bigint | undefined {
    return isStringBigIntRegExp.test(s)
      ? applyTemplateLiteralPartChecks(this, globalThis.BigInt(s), options)
      : undefined
  }
  /** @internal */
  toCodecStringTree(): AST {
    return replaceEncoding(this, [bigIntToString])
  }
  /** @internal */
  getExpected(): string {
    return "bigint"
  }
}
Referenced by 3 symbols