notWords
Создаёт действие проверки на отсутствие слов.
const Action = v.notWords<TInput, TLocales, TRequirement, TMessage>(
locales,
requirement,
message
);
Обобщённые типы
TInputextends stringTLocalesextends Intl.LocalesArgumentTRequirementextends numberTMessageextends ErrorMessage<NotWordsIssue<TInput, TRequirement>> | undefined
Параметры
localesTLocalesrequirementTRequirementmessageTMessage
Пояснение
С помощью notWords можно проверить слова в строке на основе заданного locales. Если входные данные не соответствуют requirement, можно использовать message, чтобы настроить сообщение об ошибке.
Возвращаемое значение
ActionNotWordsAction<TInput, TLocales, TRequirement, TMessage>
Примеры
В следующих примерах показано, как можно использовать notWords.
Схема notWords
Схема для проверки строки, содержащей больше или меньше 5 слов.
const NotWordsSchema = v.pipe(
v.string(),
v.notWords('en', 5, 'The string must not have 5 words.')
);
Связанные API
Следующие API можно комбинировать с notWords.
Схемы
Методы
Утилиты
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/notWords/