Skip to content

Commit

Permalink
Style cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
trek committed Oct 27, 2013
1 parent c49be96 commit 32fb53f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/fleck.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
* MIT License
*/

!function (name, definition) {
if (typeof module != 'undefined') module.exports = definition()
else if (typeof define == 'function' && typeof define.amd == 'object') define(definition)
else this[name] = definition()
}('fleck', function () {
(function (name, definition) {
if (typeof module != 'undefined') { module.exports = definition(); }
else if (typeof define == 'function' && typeof define.amd == 'object') { define(definition); }
else { this[name] = definition(); }
})('fleck', function () {

var lib = {
// plural rules, singular rules, and starting uncountables
Expand Down Expand Up @@ -84,7 +84,7 @@
inflect: function(str){
for (var i = 1, l = arguments.length; i < l; i++) {
str = lib[arguments[i]](str);
};
}

return str;
},
Expand All @@ -99,7 +99,7 @@
// lib.camelize('-moz-border-radius') == 'mozBorderRadius'
// lib.camelize("message_properties", true) == "MessageProperties"
camelize: function(str, upper){
if (upper) { return lib.upperCamelize(str) };
if (upper) { return lib.upperCamelize(str); }
return str.replace(/[-_]+(.)?/g, function(match, chr) {
return chr ? chr.toUpperCase() : '';
});
Expand All @@ -124,8 +124,8 @@
var isTeen, r, n;
n = parseInt(str, 10) % 100;
isTeen = { 11: true, 12: true, 13: true}[n];
if(isTeen) {return str + 'th'};
n = parseInt(str, 10) % 10
if(isTeen) {return str + 'th';}
n = parseInt(str, 10) % 10;
switch(n) {
case 1:
r = str + 'st';
Expand All @@ -145,13 +145,13 @@
var uncountable = lib.uncountableWords[str.toLowerCase()];
if (uncountable) {
return str;
};
}
var rules = lib.pluralRules;
for(var i = 0, l = rules.length; i < l; i++){
if (str.match(rules[i][0])) {
str = str.replace(rules[i][0], rules[i][1]);
break;
};
}
}

return str;
Expand All @@ -160,13 +160,13 @@
var uncountable = lib.uncountableWords[str.toLowerCase()];
if (uncountable) {
return str;
};
}
var rules = lib.singularRules;
for(var i = 0, l = rules.length; i < l; i++){
if (str.match(rules[i][0])) {
str = str.replace(rules[i][0], rules[i][1]);
break;
};
}
}

return str;
Expand Down

0 comments on commit 32fb53f

Please sign in to comment.