Spec-Zone.ru › Valibot

toKebabCase

Creates a to kebab case transformation action.

Words are separated by _, - and ASCII whitespace, as well as by case and acronym boundaries.

Acronym runs are normalized to lowercase (e.g. parseURLValue → parse-url-value) and digits stay attached to the preceding token (e.g. item2Name → item2-name).

const Action = v.toKebabCase();

Returns

  • Action ToKebabCaseAction

Examples

The following examples show how toKebabCase can be used.

Kebab case string

Schema that transforms a string to kebab case.

const StringSchema = v.pipe(v.string(), v.toKebabCase());

Related

The following APIs can be combined with toKebabCase.

Schemas

any, custom, string

Methods

pipe

Utils

isOfKind, isOfType

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

Spec-Zone.ru

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