Skip to content

pantoken / packages/core/src / toKebab

Fungsi: toKebab()

toKebab(str): string

Beta

Konversi string CamelCase / ber-spasi menjadi kebab-case.

Parameter

str

string

Mengembalikan

string

Contoh

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

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