es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
18 lines (13 loc) • 461 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const capitalize = require('./capitalize.js');
const words = require('./words.js');
function camelCase(str) {
const words$1 = words.words(str);
if (words$1.length === 0) {
return '';
}
const [first, ...rest] = words$1;
return `${first.toLowerCase()}${rest.map(word => capitalize.capitalize(word)).join('')}`;
}
exports.camelCase = camelCase;