6 lines
129 B
JavaScript
6 lines
129 B
JavaScript
function camelToDash(str) {
|
|
return str.replace(/([A-Z])/g, (match) => `-${match.toLowerCase()}`);
|
|
}
|
|
|
|
export { camelToDash };
|