You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
370 B

2 years ago
var splitCase = require('./splitCase');
exports = function(str) {
var arr = splitCase(str);
var ret = arr[0];
arr.shift();
arr.forEach(capitalize, arr);
ret += arr.join('');
return ret;
};
function capitalize(val, idx) {
this[idx] = val.replace(/\w/, function(match) {
return match.toUpperCase();
});
}
module.exports = exports;