|
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:
528 bytes
|
| Line | |
|---|
| 1 | /**
|
|---|
| 2 | * Converts the first character of string to upper case and the remaining to lower case.
|
|---|
| 3 | *
|
|---|
| 4 | * @param {string} string - The string to capitalize.
|
|---|
| 5 | * @returns {string} - The capitalized string.
|
|---|
| 6 | *
|
|---|
| 7 | * @example
|
|---|
| 8 | * const convertedStr1 = capitalize('fred') // returns 'Fred'
|
|---|
| 9 | * const convertedStr2 = capitalize('FRED') // returns 'Fred'
|
|---|
| 10 | * const convertedStr3 = capitalize('') // returns ''
|
|---|
| 11 | */
|
|---|
| 12 | declare function capitalize<T extends string>(str?: T): string extends T ? string : Capitalize<Lowercase<T>>;
|
|---|
| 13 |
|
|---|
| 14 | export { capitalize };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.