| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1 3344 1 3344 1 3343 3343 2 | 'use strict';
module.exports = function camelize(str) {
if (/\./.test(str)) {
str = str.split('.')[0];
}
if (str.length === 1) {
return str;
}
str = str.replace(/^[-_.\s]+/, '').toLowerCase();
return str.replace(/[-_.]+(\w|$)/g, function (_, ch) {
return ch.toUpperCase();
});
};
|