|
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
|
| Rev | Line | |
|---|
| [a762898] | 1 | import { capitalize } from './capitalize.mjs';
|
|---|
| 2 | import { words } from './words.mjs';
|
|---|
| 3 |
|
|---|
| 4 | function 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 |
|
|---|
| 13 | export { camelCase };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.