Skip to content

pantoken-root / packages/core/src / toKebab

Hàm: toKebab() ​

toKebab(str): string

Beta

Chuyển một chuỗi CamelCase / chuỗi có khoảng trắng sang kebab-case.

Tham số ​

str ​

string

Trả về ​

string

Ví dụ ​

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

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