PabloVallejo
7/25/2013 - 8:20 PM

cammelCaseToHyphen

cammelCaseToHyphen

diff --git a/assets/js/helpers/utilities.js b/assets/js/helpers/utilities.js
index a34e884..21330fc 100644
--- a/assets/js/helpers/utilities.js
+++ b/assets/js/helpers/utilities.js
@@ -297,6 +297,18 @@
             }
 
             /**
+            * Converts a cammelcased string to dashed one one
+            * `sampleString`, `sample-string`
+            */
+        ,   cammelCaseToHyphen: function( string ) {
+
+                return string.replace( /([A-Z])/g, function( $1 ) {
+
+                    return "-" + $1 . toLowerCase();
+                });
+            }
+
+            /**
             * Converts hiphens to underscores
             */
         ,   hyphenToUnderscore: function( string ) {