aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/utils.js')
-rw-r--r--src/utils/utils.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/utils/utils.js b/src/utils/utils.js
index e3c9111..64c0eed 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -41,6 +41,13 @@ export function camelCase (s) {
})
}
+// Convert camel cased string to string seperated
+export function unCamelCase (s) {
+ return s.replace(/([A-Z])/g, function (m, g) {
+ return '-' + g.toLowerCase()
+ })
+}
+
// Capitalize first letter of a string
export function capitalize (s) {
return s.charAt(0).toUpperCase() + s.slice(1)