Skip to content

pantoken-root / packages/core/src / toKebab

Funktion: toKebab() ​

toKebab(str): string

Beta

Konvertiert einen CamelCase- oder durch Leerzeichen getrennten String in kebab-case.

Parameter ​

str ​

string

Rückgabe ​

string

Beispiel ​

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

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