chore: eslint prefer-destructuring

This commit is contained in:
Peter Jaszkowiak
2021-02-06 14:10:15 -07:00
committed by Julian Lam
parent 8d1462ffd8
commit 23f212a4c0
143 changed files with 192 additions and 195 deletions

View File

@@ -46,7 +46,7 @@ postgresModule.questions = [
];
postgresModule.init = async function () {
const Pool = require('pg').Pool;
const { Pool } = require('pg');
const connOptions = connection.getConnectionOptions();
const pool = new Pool(connOptions);
postgresModule.pool = pool;

View File

@@ -34,7 +34,7 @@ connection.getConnectionOptions = function (postgres) {
};
connection.connect = async function (options) {
const Pool = require('pg').Pool;
const { Pool } = require('pg');
const connOptions = connection.getConnectionOptions(options);
const db = new Pool(connOptions);
await db.connect();

View File

@@ -41,7 +41,7 @@ module.exports = function (module) {
};
module.scan = async function (params) {
let match = params.match;
let { match } = params;
if (match.startsWith('*')) {
match = `%${match.substring(1)}`;
}

View File

@@ -606,7 +606,7 @@ DELETE FROM "legacy_zset" z
}
module.getSortedSetScan = async function (params) {
let match = params.match;
let { match } = params;
if (match.startsWith('*')) {
match = `%${match.substring(1)}`;
}

View File

@@ -37,7 +37,7 @@ SELECT COUNT(*) c
};
async function getSortedSetIntersect(params) {
const sets = params.sets;
const { sets } = params;
const start = params.hasOwnProperty('start') ? params.start : 0;
const stop = params.hasOwnProperty('stop') ? params.stop : -1;
let weights = params.weights || [];

View File

@@ -31,7 +31,7 @@ SELECT COUNT(DISTINCT z."value") c
};
async function getSortedSetUnion(params) {
const sets = params.sets;
const { sets } = params;
const start = params.hasOwnProperty('start') ? params.start : 0;
const stop = params.hasOwnProperty('stop') ? params.stop : -1;
let weights = params.weights || [];

View File

@@ -3,7 +3,7 @@
const nconf = require('nconf');
const util = require('util');
const winston = require('winston');
const EventEmitter = require('events').EventEmitter;
const { EventEmitter } = require('events');
const connection = require('./connection');
let channelName;

View File

@@ -30,7 +30,7 @@ module.exports = function (module) {
};
async function getSortedSetRevIntersect(params) {
const sets = params.sets;
const { sets } = params;
const start = params.hasOwnProperty('start') ? params.start : 0;
const stop = params.hasOwnProperty('stop') ? params.stop : -1;
const weights = params.weights || [];