UNPKG

lenye_base

Version:

基础方法

15 lines (12 loc) 278 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;