mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 02:36:16 +01:00
chore: eslint no-var, vars-on-top
This commit is contained in:
committed by
Julian Lam
parent
b56d9e12b5
commit
dab3b23575
@@ -56,7 +56,7 @@ module.exports = function (module) {
|
||||
if (!field) {
|
||||
return;
|
||||
}
|
||||
var data = {};
|
||||
const data = {};
|
||||
data[field] = value;
|
||||
await module.setObject(key, data);
|
||||
};
|
||||
@@ -177,7 +177,7 @@ module.exports = function (module) {
|
||||
return;
|
||||
}
|
||||
|
||||
var data = {};
|
||||
const data = {};
|
||||
fields.forEach((field) => {
|
||||
field = helpers.fieldToString(field);
|
||||
data[field] = '';
|
||||
@@ -205,12 +205,12 @@ module.exports = function (module) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var increment = {};
|
||||
const increment = {};
|
||||
field = helpers.fieldToString(field);
|
||||
increment[field] = value;
|
||||
|
||||
if (Array.isArray(key)) {
|
||||
var bulk = module.client.collection('objects').initializeUnorderedBulkOp();
|
||||
const bulk = module.client.collection('objects').initializeUnorderedBulkOp();
|
||||
key.forEach((key) => {
|
||||
bulk.find({ _key: key }).upsert().update({ $inc: increment });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user