UNPKG

bbo

Version:

bbo is a utility library of zero dependencies for javascript.

17 lines (13 loc) 293 B
'use strict'; /** * _ 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(); }); } module.exports = camelize;