UNPKG

@thot/components

Version:
9 lines (7 loc) 201 B
const toKebabCase = (string) => string .replace(/([A-Z])([A-Z])/g, '$1-$2') .replace(/([a-z])([A-Z])/g, '$1-$2') .replace(/[\s_]+/g, '-') .toLowerCase() module.exports = toKebabCase