remove all changes from eslint --fix

This commit is contained in:
Matteo Pagliazzi
2016-03-08 17:45:14 +01:00
parent eeebe4c342
commit 5a2daabada
37 changed files with 224 additions and 223 deletions

View File

@@ -2,27 +2,27 @@ import i18n from '../i18n';
import _ from 'lodash';
import splitWhitespace from '../libs/splitWhitespace';
module.exports = function (user, req, cb, analytics) {
module.exports = function(user, req, cb, analytics) {
var alreadyOwns, analyticsData, cost, fullSet, k, path, split, v;
path = req.query.path;
fullSet = ~path.indexOf(',');
fullSet = ~path.indexOf(",");
cost = ~path.indexOf('background.') ? fullSet ? 3.75 : 1.75 : fullSet ? 1.25 : 0.5;
alreadyOwns = !fullSet && user.fns.dotGet('purchased.' + path) === true;
alreadyOwns = !fullSet && user.fns.dotGet("purchased." + path) === true;
if ((user.balance < cost || !user.balance) && !alreadyOwns) {
return typeof cb === 'function' ? cb({
return typeof cb === "function" ? cb({
code: 401,
message: i18n.t('notEnoughGems', req.language)
}) : void 0;
}
if (fullSet) {
_.each(path.split(','), function (p) {
_.each(path.split(","), function(p) {
if (~path.indexOf('gear.')) {
user.fns.dotSet('' + p, true);
user.fns.dotSet("" + p, true);
true;
} else {
}
user.fns.dotSet('purchased.' + p, true);
user.fns.dotSet("purchased." + p, true);
return true;
});
} else {
@@ -33,18 +33,18 @@ module.exports = function (user, req, cb, analytics) {
if (k === 'background' && v === user.preferences.background) {
v = '';
}
user.fns.dotSet('preferences.' + k, v);
return typeof cb === 'function' ? cb(null, req) : void 0;
user.fns.dotSet("preferences." + k, v);
return typeof cb === "function" ? cb(null, req) : void 0;
}
user.fns.dotSet('purchased.' + path, true);
user.fns.dotSet("purchased." + path, true);
}
user.balance -= cost;
if (~path.indexOf('gear.')) {
if (typeof user.markModified === 'function') {
if (typeof user.markModified === "function") {
user.markModified('gear.owned');
}
} else {
if (typeof user.markModified === 'function') {
if (typeof user.markModified === "function") {
user.markModified('purchased');
}
}
@@ -56,8 +56,8 @@ module.exports = function (user, req, cb, analytics) {
gemCost: cost / .25,
category: 'behavior'
};
if (analytics !== null) {
if (analytics != null) {
analytics.track('acquire item', analyticsData);
}
return typeof cb === 'function' ? cb(null, _.pick(user, splitWhitespace('purchased preferences items'))) : void 0;
return typeof cb === "function" ? cb(null, _.pick(user, splitWhitespace('purchased preferences items'))) : void 0;
};