mirror of
https://github.com/Rushilwiz/spaceout.git
synced 2025-04-22 04:19:49 -04:00
11 lines
275 B
JavaScript
11 lines
275 B
JavaScript
/**
|
|
* Convert camelCase to kebab-case
|
|
* @param {string} str input string in camelCase
|
|
* @returns {string} output string in kebab-case
|
|
*/
|
|
function toKebabCase(str) {
|
|
return str.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();
|
|
}
|
|
|
|
module.exports = { toKebabCase };
|