diff --git a/src/core/Base.js b/src/core/Base.js index 009c779f..4af0227d 100644 --- a/src/core/Base.js +++ b/src/core/Base.js @@ -141,7 +141,7 @@ this.Base = Base.inject(/** @lends Base# */{ }, /** - * Camelizes the passed string: caps-lock -> capsLock + * Camelizes the passed hyphenated string: caps-lock -> capsLock */ camelize: function(str) { return str.replace(/-(\w)/g, function(all, chr) { @@ -149,6 +149,9 @@ this.Base = Base.inject(/** @lends Base# */{ }); }, + /** + * Converst camelized strings to hyphenated ones: CapsLock -> caps-lock + */ hyphenate: function(str) { return str.replace(/[a-z][A-Z0-9]|[0-9][a-zA-Z]|[A-Z]{2}[a-z]/g, function(match) {