We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cebbdb commit 1cd8b6fCopy full SHA for 1cd8b6f
packages/common/src/util/camelCaseToAllDown.ts
@@ -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
+ */
11
export function camelCaseToAllDown(input: string): string {
12
return input
13
.replace(/([A-Z])/g, " $1")
0 commit comments