Skip to content

pantoken-root / packages/core/src / toKebab

Fonction: toKebab() ​

toKebab(str): string

Bêta

Convertir une chaîne CamelCase / contenant des espaces en kebab-case.

Paramètres ​

str ​

string

Renvoie ​

string

Exemple ​

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

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