Spec-Zone.ru › Valibot

toBigint

Creates a to bigint transformation action.

const Action = v.toBigint<TInput, TMessage>(message);

Generics

  • TInput extends any
  • TMessage extends ErrorMessage<ToBigintIssue<TInput>> | undefined

Parameters

  • message TMessage

Explanation

With toBigint you can transform the input to a bigint. If the input cannot be transformed, you can use message to customize the error message.

Returns

  • Action ToBigintAction<TInput, TMessage>

Examples

The following examples show how toBigint can be used.

Number schema

Schema to validate a number and transform it to a bigint.

const NumberSchema = v.pipe(v.number(), v.toBigint());

Related

The following APIs can be combined with toBigint.

Schemas

any, boolean, custom, number, string, unknown

Methods

pipe

Utils

isOfKind, isOfType

© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/toBigint/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API