From bc46609fbc2d1d69f74c6fe045eb1a4ed5def967 Mon Sep 17 00:00:00 2001 From: Blade Barringer Date: Mon, 28 Sep 2015 07:44:31 -0500 Subject: [PATCH] Use shorthand function syntax --- common/script/src/content/gear/eyewear.js | 2 +- .../script/src/content/gear/head-accessory.js | 16 ++++----- common/script/src/content/gear/head.js | 34 +++++++++---------- common/script/src/content/gear/index.js | 12 +++---- .../script/src/content/gear/sets/armoire.js | 12 +++---- .../script/src/content/gear/sets/special.js | 10 +++--- common/script/src/content/gear/shield.js | 10 +++--- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/common/script/src/content/gear/eyewear.js b/common/script/src/content/gear/eyewear.js index cc264d544c..8f00033505 100644 --- a/common/script/src/content/gear/eyewear.js +++ b/common/script/src/content/gear/eyewear.js @@ -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; }) } diff --git a/common/script/src/content/gear/head-accessory.js b/common/script/src/content/gear/head-accessory.js index 0243066180..7864e691fa 100644 --- a/common/script/src/content/gear/head-accessory.js +++ b/common/script/src/content/gear/head-accessory.js @@ -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; }) } diff --git a/common/script/src/content/gear/head.js b/common/script/src/content/gear/head.js index 0679eadcfd..400c44a2fd 100644 --- a/common/script/src/content/gear/head.js +++ b/common/script/src/content/gear/head.js @@ -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; }) } diff --git a/common/script/src/content/gear/index.js b/common/script/src/content/gear/index.js index 1e870e376b..245e73fd74 100644 --- a/common/script/src/content/gear/index.js +++ b/common/script/src/content/gear/index.js @@ -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; }; } diff --git a/common/script/src/content/gear/sets/armoire.js b/common/script/src/content/gear/sets/armoire.js index ccb1b58e23..6d29860710 100644 --- a/common/script/src/content/gear/sets/armoire.js +++ b/common/script/src/content/gear/sets/armoire.js @@ -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; }) } diff --git a/common/script/src/content/gear/sets/special.js b/common/script/src/content/gear/sets/special.js index 974426fe29..e259752bd7 100644 --- a/common/script/src/content/gear/sets/special.js +++ b/common/script/src/content/gear/sets/special.js @@ -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; }) }, diff --git a/common/script/src/content/gear/shield.js b/common/script/src/content/gear/shield.js index a204f134be..9051b9bd64 100644 --- a/common/script/src/content/gear/shield.js +++ b/common/script/src/content/gear/shield.js @@ -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; }) }