Skip to content

Commit 1cd8b6f

Browse files
committed
Doc string
1 parent 2cebbdb commit 1cd8b6f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

packages/common/src/util/camelCaseToAllDown.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
/**
2+
* Converts a camelCase string to a string with spaces between each word, and
3+
* all words in lowercase.
4+
*
5+
* Example: `camelCaseToAllDown("fooBarBaz")` returns `"foo bar baz"`.
6+
*
7+
* @param input A camelCase string
8+
* @returns The same string, but with spaces between each word, and all words
9+
* in lowercase
10+
*/
111
export function camelCaseToAllDown(input: string): string {
212
return input
313
.replace(/([A-Z])/g, " $1")

0 commit comments

Comments
 (0)