Skip to content

pantoken / packages/core/src / toKebab

Функція: toKebab()

toKebab(str): string

Бета

Перетворити рядок CamelCase / рядок з пробілами в kebab-case.

Параметри

str

string

Повертає

string

Приклад

ts
import { toKebab } from "@pantoken/core";

toKebab("baseButton");   // → "base-button"
toKebab("Font Family");  // → "font-family"
toKebab("rebrandLight"); // → "rebrand-light"