mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
chore: eslint prefer-destructuring
This commit is contained in:
committed by
Julian Lam
parent
8d1462ffd8
commit
23f212a4c0
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)}`;
|
||||
}
|
||||
|
||||
@@ -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)}`;
|
||||
}
|
||||
|
||||
@@ -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 || [];
|
||||
|
||||
@@ -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 || [];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 || [];
|
||||
|
||||
Reference in New Issue
Block a user