|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
758 bytes
|
| Rev | Line | |
|---|
| [a762898] | 1 | /**
|
|---|
| 2 | * Converts a string to constant case.
|
|---|
| 3 | *
|
|---|
| 4 | * Constant case is a naming convention where each word is written in uppercase letters and separated by an underscore (`_`). For example, `CONSTANT_CASE`.
|
|---|
| 5 | *
|
|---|
| 6 | * @param {string} str - The string that is to be changed to constant case.
|
|---|
| 7 | * @returns {string} - The converted string to constant case.
|
|---|
| 8 | *
|
|---|
| 9 | * @example
|
|---|
| 10 | * const convertedStr1 = constantCase('camelCase') // returns 'CAMEL_CASE'
|
|---|
| 11 | * const convertedStr2 = constantCase('some whitespace') // returns 'SOME_WHITESPACE'
|
|---|
| 12 | * const convertedStr3 = constantCase('hyphen-text') // returns 'HYPHEN_TEXT'
|
|---|
| 13 | * const convertedStr4 = constantCase('HTTPRequest') // returns 'HTTP_REQUEST'
|
|---|
| 14 | */
|
|---|
| 15 | declare function constantCase(str: string): string;
|
|---|
| 16 |
|
|---|
| 17 | export { constantCase };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.