hyphenate.js 124 Bytes
Newer Older
Sangjune Bae's avatar
Sangjune Bae committed
1
2
3
4
var rUpper = /([A-Z])/g;
export default function hyphenate(string) {
  return string.replace(rUpper, '-$1').toLowerCase();
}