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());
|
return setImmediate(() => callback());
|
||||||
}
|
}
|
||||||
module.exports.redis.multi().
|
module.exports.redis.multi().
|
||||||
lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)).
|
lpush('mailtrain:cache:' + key, stringifyDate.stringify(value)).
|
||||||
expire('mailtrain:cache:' + key, 24 * 3600).
|
expire('mailtrain:cache:' + key, 24 * 3600).
|
||||||
exec(err => callback(err));
|
exec(err => callback(err));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports.getFromCache = (key, callback) => {
|
module.exports.getFromCache = (key, callback) => {
|
||||||
|
|
|
@ -4,11 +4,11 @@ const path = require('path');
|
||||||
|
|
||||||
function nameToFileName(name) {
|
function nameToFileName(name) {
|
||||||
return name.
|
return name.
|
||||||
trim().
|
trim().
|
||||||
toLowerCase().
|
toLowerCase().
|
||||||
replace(/[ .+/]/g, '-').
|
replace(/[ .+/]/g, '-').
|
||||||
replace(/[^a-z0-9\-_]/gi, '').
|
replace(/[^a-z0-9\-_]/gi, '').
|
||||||
replace(/--*/g, '-');
|
replace(/--*/g, '-');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -398,6 +398,7 @@ module.exports.getRow = (fieldList, values, useDate, showAll, onlyExisting) => {
|
||||||
// ignore missing values
|
// ignore missing values
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
/* eslint-disable indent */
|
||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case 'text':
|
case 'text':
|
||||||
case 'website':
|
case 'website':
|
||||||
|
@ -574,6 +575,7 @@ module.exports.getRow = (fieldList, values, useDate, showAll, onlyExisting) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* eslint-enable indent */
|
||||||
});
|
});
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
|
|
18
lib/tools.js
18
lib/tools.js
|
@ -35,12 +35,12 @@ module.exports = {
|
||||||
|
|
||||||
function toDbKey(key) {
|
function toDbKey(key) {
|
||||||
return key.
|
return key.
|
||||||
replace(/[^a-z0-9\-_]/gi, '').
|
replace(/[^a-z0-9\-_]/gi, '').
|
||||||
replace(/\-+/g, '_').
|
replace(/\-+/g, '_').
|
||||||
replace(/[A-Z]/g, c => '_' + c.toLowerCase()).
|
replace(/[A-Z]/g, c => '_' + c.toLowerCase()).
|
||||||
replace(/^_+|_+$/g, '').
|
replace(/^_+|_+$/g, '').
|
||||||
replace(/_+/g, '_').
|
replace(/_+/g, '_').
|
||||||
trim();
|
trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
function fromDbKey(key) {
|
function fromDbKey(key) {
|
||||||
|
@ -71,9 +71,9 @@ function convertKeys(obj, options) {
|
||||||
|
|
||||||
function queryParams(obj) {
|
function queryParams(obj) {
|
||||||
return Object.keys(obj).
|
return Object.keys(obj).
|
||||||
filter(key => key !== '_csrf').
|
filter(key => key !== '_csrf').
|
||||||
map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])).
|
map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key])).
|
||||||
join('&');
|
join('&');
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSlug(table, name, callback) {
|
function createSlug(table, name, callback) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue