source: node_modules/es-toolkit/dist/string/camelCase.mjs@ ba17441

Last change on this file since ba17441 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 346 bytes
Line 
1import { capitalize } from './capitalize.mjs';
2import { words } from './words.mjs';
3
4function camelCase(str) {
5 const words$1 = words(str);
6 if (words$1.length === 0) {
7 return '';
8 }
9 const [first, ...rest] = words$1;
10 return `${first.toLowerCase()}${rest.map(word => capitalize(word)).join('')}`;
11}
12
13export { camelCase };
Note: See TracBrowser for help on using the repository browser.