source: node_modules/es-toolkit/dist/string/startCase.js@ a762898

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

Added visualizations

  • Property mode set to 100644
File size: 488 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const words = require('./words.js');
6
7function startCase(str) {
8 const words$1 = words.words(str.trim());
9 let result = '';
10 for (let i = 0; i < words$1.length; i++) {
11 const word = words$1[i];
12 if (result) {
13 result += ' ';
14 }
15 result += word[0].toUpperCase() + word.slice(1).toLowerCase();
16 }
17 return result;
18}
19
20exports.startCase = startCase;
Note: See TracBrowser for help on using the repository browser.