framework/js/lib/utils/string.js
2015-05-06 08:32:33 +09:30

6 lines
131 B
JavaScript

export function dasherize(string) {
return string.replace(/([A-Z])/g, function ($1) {
return '-' + $1.toLowerCase();
});
}