Spec-Zone.ru › Valibot

notGraphemes

Создает действие проверки на отсутствие графем.

const Action = v.notGraphemes<TInput, TRequirement, TMessage>(
  requirement,
  message
);

Обобщения

  • TInput extends string
  • TRequirement extends number
  • TMessage extends ErrorMessage<NotGraphemesIssue<TInput, TRequirement>> | undefined

Параметры

  • requirement TRequirement
  • message TMessage

Пояснение

С помощью notGraphemes можно проверять графемы строки. Если входные данные не соответствуют requirement, можно использовать message, чтобы настроить сообщение об ошибке.

Возвращает

  • Action NotGraphemesAction<TInput, TRequirement, TMessage>

Примеры

В следующих примерах показано, как можно использовать notGraphemes.

Схема notGraphemes

Схема для проверки строки, содержащей больше или меньше 8 графем.

const NotGraphemesSchema = v.pipe(
  v.string(),
  v.notGraphemes(8, 'The string must not have 8 graphemes.')
);

Связанные API

Следующие API можно комбинировать с notGraphemes.

Схемы

any, custom, string

Методы

pipe

Действия

notCodePoints, notLength

Утилиты

isOfKind, isOfType

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

Spec-Zone.ru

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