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"