source: node_modules/es-toolkit/dist/string/startCase.mjs

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

Added visualizations

  • Property mode set to 100644
File size: 384 bytes
Line 
1import { words } from './words.mjs';
2
3function startCase(str) {
4 const words$1 = words(str.trim());
5 let result = '';
6 for (let i = 0; i < words$1.length; i++) {
7 const word = words$1[i];
8 if (result) {
9 result += ' ';
10 }
11 result += word[0].toUpperCase() + word.slice(1).toLowerCase();
12 }
13 return result;
14}
15
16export { startCase };
Note: See TracBrowser for help on using the repository browser.