Sha256: 17a1449bb473c704d951acbcd98ef0418b91f8f37674452ae29706eb823df410
Contents?: true
Size: 1.2 KB
Versions: 19
Compression:
Stored size: 1.2 KB
Contents
(function() { String.prototype.toCamel = function() { var str; str = this.replace(/((\-|_)[a-z])/g, function($1) { return $1[1].toUpperCase(); }); return str[0].toLowerCase() + str.slice(1); }; String.prototype.toCapitalCamel = function() { var str; str = this.toCamel(); return str[0].toUpperCase() + str.slice(1); }; String.prototype.toDash = function() { var str; str = this.replace(/(_[a-z]|[A-Z])/g, function($1) { return "-" + $1.replace('_', ''); }); if (str[0] === "-") { str = str.slice(1); } return str.toLowerCase(); }; String.prototype.toUnderscore = function() { var str; str = this.replace(/(\-[a-z]|[A-Z])/g, function($1) { return "_" + $1.replace('-', ''); }); if (str[0] === "_") { str = str.slice(1); } return str.toLowerCase(); }; String.prototype.toLabel = function() { var str; str = this.replace(/(\-[a-z]|_[a-z]|[A-Z])/g, function($1) { var ref; return " " + ($1[1] ? (ref = $1[1]) != null ? ref.toUpperCase() : void 0 : $1); }); if (str[0] === " ") { str = str.slice(1); } return str[0].toUpperCase() + str.slice(1); }; }).call(this);
Version data entries
19 entries across 19 versions & 1 rubygems