Use shorthand function syntax

This commit is contained in:
Blade Barringer
2015-09-28 07:44:31 -05:00
parent 86fd9cf32a
commit bc46609fbc
7 changed files with 48 additions and 48 deletions

View File

@@ -76,7 +76,7 @@ let eyewear = {
notes: t('eyewearArmoirePlagueDoctorMaskNotes'),
value: 100,
set: 'plagueDoctor',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.eyewear_armoire_plagueDoctorMask != null;
})
}

View File

@@ -72,7 +72,7 @@ let headAccessory = {
text: t('headAccessoryBearEarsText'),
notes: t('headAccessoryBearEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_bearEars != null;
})
},
@@ -81,7 +81,7 @@ let headAccessory = {
text: t('headAccessoryCactusEarsText'),
notes: t('headAccessoryCactusEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_cactusEars != null;
})
},
@@ -90,7 +90,7 @@ let headAccessory = {
text: t('headAccessoryFoxEarsText'),
notes: t('headAccessoryFoxEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_foxEars != null;
})
},
@@ -99,7 +99,7 @@ let headAccessory = {
text: t('headAccessoryLionEarsText'),
notes: t('headAccessoryLionEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_lionEars != null;
})
},
@@ -108,7 +108,7 @@ let headAccessory = {
text: t('headAccessoryPandaEarsText'),
notes: t('headAccessoryPandaEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_pandaEars != null;
})
},
@@ -117,7 +117,7 @@ let headAccessory = {
text: t('headAccessoryPigEarsText'),
notes: t('headAccessoryPigEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_pigEars != null;
})
},
@@ -126,7 +126,7 @@ let headAccessory = {
text: t('headAccessoryTigerEarsText'),
notes: t('headAccessoryTigerEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_tigerEars != null;
})
},
@@ -135,7 +135,7 @@ let headAccessory = {
text: t('headAccessoryWolfEarsText'),
notes: t('headAccessoryWolfEarsNotes'),
value: 20,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.headAccessory_special_wolfEars != null;
})
}

View File

@@ -24,7 +24,7 @@ let head = {
}),
int: 20,
value: 150,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.backer) != null ? ref.tier : void 0) >= 45;
})
@@ -39,7 +39,7 @@ let head = {
per: 6,
int: 6,
value: 170,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.contributor) != null ? ref.level : void 0) >= 3;
})
@@ -52,7 +52,7 @@ let head = {
int: 25,
str: 25,
value: 200,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return (+((ref = u.backer) != null ? ref.tier : void 0) >= 300) || (u.items.gear.owned.head_special_2 != null);
})
@@ -64,7 +64,7 @@ let head = {
}),
per: 15,
value: 130,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_special_fireCoralCirclet != null;
})
},
@@ -278,7 +278,7 @@ let head = {
text: t('headSpecialNye2014Text'),
notes: t('headSpecialNye2014Notes'),
value: 0,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_special_nye2014 != null;
})
},
@@ -500,7 +500,7 @@ let head = {
con: 7,
per: 7,
set: 'soothing',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_lunarCrown != null;
})
},
@@ -515,7 +515,7 @@ let head = {
str: 5,
int: 5,
con: 5,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_redHairbow != null;
})
},
@@ -530,7 +530,7 @@ let head = {
per: 5,
int: 5,
con: 5,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_violetFloppyHat != null;
})
},
@@ -544,7 +544,7 @@ let head = {
per: 7,
int: 7,
set: 'gladiator',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_gladiatorHelm != null;
})
},
@@ -560,7 +560,7 @@ let head = {
per: 5,
int: 5,
set: 'rancher',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_rancherHat != null;
})
},
@@ -571,7 +571,7 @@ let head = {
}),
value: 100,
str: 10,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_royalCrown != null;
})
},
@@ -586,7 +586,7 @@ let head = {
per: 5,
int: 5,
con: 5,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_blueHairbow != null;
})
},
@@ -599,7 +599,7 @@ let head = {
per: 8,
con: 8,
set: 'goldenToga',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_goldenLaurels != null;
})
},
@@ -613,7 +613,7 @@ let head = {
con: 9,
str: 7,
set: 'hornedIron',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_hornedIronHelm != null;
})
},
@@ -626,7 +626,7 @@ let head = {
int: 5,
per: 5,
str: 5,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_yellowHairbow != null;
})
},
@@ -639,7 +639,7 @@ let head = {
con: 6,
int: 6,
per: 6,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_redFloppyHat != null;
})
},
@@ -655,7 +655,7 @@ let head = {
str: 6,
con: 5,
set: 'plagueDoctor',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.head_armoire_plagueDoctorHat != null;
})
}

View File

@@ -32,11 +32,11 @@ let flat = {};
// The gear is exported as a tree (defined above), and a flat list (eg, {weapon_healer_1: .., shield_special_0: ...}) since
// they are needed in different forms at different points in the app
each(GEAR_TYPES, function(type) {
each(GEAR_TYPES, (type) => {
let classTypes = classes.concat(['base', 'special', 'mystery', 'armoire']);
each(classTypes, function(klass) {
each(gear[type][klass], function(item, i) {
each(classTypes, (klass) => {
each(gear[type][klass], (item, i) => {
let key = type + "_" + klass + "_" + i;
defaults(item, {
type: type,
@@ -49,15 +49,15 @@ each(GEAR_TYPES, function(type) {
con: 0
});
if (item.event) {
let _canOwn = item.canOwn || (function() {
let _canOwn = item.canOwn || (() => {
return true;
});
item.canOwn = function(u) {
item.canOwn = (u) => {
return _canOwn(u) && ((u.items.gear.owned[key] != null) || (moment().isAfter(item.event.start) && moment().isBefore(item.event.end))) && (item.specialClass ? u.stats["class"] === item.specialClass : true);
};
}
if (item.mystery) {
item.canOwn = function(u) {
item.canOwn = (u) => {
return u.items.gear.owned[key] != null;
};
}

View File

@@ -12,7 +12,7 @@ export var armor = {
str: 7,
int: 7,
set: 'soothing',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_lunarArmor != null;
})
},
@@ -26,7 +26,7 @@ export var armor = {
str: 7,
per: 7,
set: 'gladiator',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_gladiatorArmor != null;
})
},
@@ -42,7 +42,7 @@ export var armor = {
per: 5,
int: 5,
set: 'rancher',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_rancherRobes != null;
})
},
@@ -55,7 +55,7 @@ export var armor = {
str: 8,
con: 8,
set: 'goldenToga',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_goldenToga != null;
})
},
@@ -69,7 +69,7 @@ export var armor = {
con: 9,
per: 7,
set: 'hornedIron',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_hornedIronArmor != null;
})
},
@@ -85,7 +85,7 @@ export var armor = {
str: 5,
con: 6,
set: 'plagueDoctor',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_armoire_plagueDoctorOvercoat != null;
})
}

View File

@@ -9,7 +9,7 @@ export var armor = {
}),
con: 20,
value: 150,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.backer) != null ? ref.tier : void 0) >= 45;
})
@@ -24,7 +24,7 @@ export var armor = {
per: 6,
int: 6,
value: 170,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.contributor) != null ? ref.level : void 0) >= 2;
})
@@ -37,7 +37,7 @@ export var armor = {
int: 25,
con: 25,
value: 200,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.backer) != null ? ref.tier : void 0) >= 300 || (u.items.gear.owned.armor_special_2 != null);
})
@@ -49,7 +49,7 @@ export var armor = {
}),
str: 15,
value: 130,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_special_finnedOceanicArmor != null;
})
},
@@ -263,7 +263,7 @@ export var armor = {
text: t('armorSpecialBirthday2015Text'),
notes: t('armorSpecialBirthday2015Notes'),
value: 0,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.armor_special_birthday2015 != null;
})
},

View File

@@ -24,7 +24,7 @@ let shield = {
}),
per: 20,
value: 150,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.backer) != null ? ref.tier : void 0) >= 45;
})
@@ -39,7 +39,7 @@ let shield = {
per: 6,
int: 6,
value: 170,
canOwn: (function(u) {
canOwn: ((u) => {
var ref;
return +((ref = u.contributor) != null ? ref.level : void 0) >= 5;
})
@@ -52,7 +52,7 @@ let shield = {
con: 25,
per: 25,
value: 200,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.shield_special_goldenknight != null;
})
},
@@ -63,7 +63,7 @@ let shield = {
}),
con: 15,
value: 130,
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.shield_special_moonpearlShield != null;
})
},
@@ -327,7 +327,7 @@ let shield = {
con: 5,
str: 5,
set: 'gladiator',
canOwn: (function(u) {
canOwn: ((u) => {
return u.items.gear.owned.shield_armoire_gladiatorShield != null;
})
}