Satisfy new eslint indentation rule
This commit is contained in:
parent
1db7bd9873
commit
2da90b58e4
4 changed files with 19 additions and 17 deletions
|
@ -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) => {
|
||||
|
|
|
@ -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, '-');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
18
lib/tools.js
18
lib/tools.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue