UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

15 lines (12 loc) 276 B
/** * _ or - to CamelCase */ function camelize(target) { if (target.indexOf('-') < 0 && target.indexOf('_') < 0) { return target; } return target.replace(/[-_][^-_]/g, function (match) { return match.charAt(1).toUpperCase(); }); } export default camelize;