Satisfy new eslint indentation rule

This commit is contained in:
witzig 2017-06-15 21:26:35 +02:00
parent 1db7bd9873
commit 2da90b58e4
4 changed files with 19 additions and 17 deletions

View file

@ -43,9 +43,9 @@ if (config.redis && config.redis.enabled) {
return setImmediate(() => callback());
}
module.exports.redis.multi().
lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)).
expire('mailtrain:cache:' + key, 24 * 3600).
exec(err => callback(err));
lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)).
expire('mailtrain:cache:' + key, 24 * 3600).
exec(err => callback(err));
};
module.exports.getFromCache = (key, callback) => {

View file

@ -4,11 +4,11 @@ const path = require('path');
function nameToFileName(name) {
return name.
trim().
toLowerCase().
replace(/[ .+/]/g, '-').
replace(/[^a-z0-9\-_]/gi, '').
replace(/--*/g, '-');
trim().
toLowerCase().
replace(/[ .+/]/g, '-').
replace(/[^a-z0-9\-_]/gi, '').
replace(/--*/g, '-');
}

View file

@ -398,6 +398,7 @@ module.exports.getRow = (fieldList, values, useDate, showAll, onlyExisting) => {
// ignore missing values
return;
}
/* eslint-disable indent */
switch (field.type) {
case 'text':
case 'website':
@ -574,6 +575,7 @@ module.exports.getRow = (fieldList, values, useDate, showAll, onlyExisting) => {
break;
}
}
/* eslint-enable indent */
});
return row;

View file

@ -35,12 +35,12 @@ module.exports = {
function toDbKey(key) {
return key.
replace(/[^a-z0-9\-_]/gi, '').
replace(/\-+/g, '_').
replace(/[A-Z]/g, c => '_' + c.toLowerCase()).
replace(/^_+|_+$/g, '').
replace(/_+/g, '_').
trim();
replace(/[^a-z0-9\-_]/gi, '').
replace(/\-+/g, '_').
replace(/[A-Z]/g, c => '_' + c.toLowerCase()).
replace(/^_+|_+$/g, '').
replace(/_+/g, '_').
trim();
}
function fromDbKey(key) {
@ -71,9 +71,9 @@ function convertKeys(obj, options) {
function queryParams(obj) {
return Object.keys(obj).
filter(key => key !== '_csrf').
map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])).
join('&');
filter(key => key !== '_csrf').
map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])).
join('&');
}
function createSlug(table, name, callback) {