notGraphemes
Создает действие проверки на отсутствие графем.
const Action = v.notGraphemes<TInput, TRequirement, TMessage>(
requirement,
message
);
Обобщения
TInputextends stringTRequirementextends numberTMessageextends ErrorMessage<NotGraphemesIssue<TInput, TRequirement>> | undefined
Параметры
requirementTRequirementmessageTMessage
Пояснение
С помощью notGraphemes можно проверять графемы строки. Если входные данные не соответствуют requirement, можно использовать message, чтобы настроить сообщение об ошибке.
Возвращает
ActionNotGraphemesAction<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.
Схемы
Методы
Действия
Утилиты
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/notGraphemes/