mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 16:30:34 +01:00
refactor: switch eslint configs to esm
add rules from https://eslint.style/ refactor for in loops to use Object.entries
This commit is contained in:
@@ -180,14 +180,12 @@ module.exports = function (utils, Benchpress, relative_path) {
|
||||
|
||||
function spawnPrivilegeStates(cid, member, privileges, types) {
|
||||
const states = [];
|
||||
for (const priv in privileges) {
|
||||
if (privileges.hasOwnProperty(priv)) {
|
||||
states.push({
|
||||
name: priv,
|
||||
state: privileges[priv],
|
||||
type: types[priv],
|
||||
});
|
||||
}
|
||||
for (const [priv, state] of Object.entries(privileges)) {
|
||||
states.push({
|
||||
name: priv,
|
||||
state: state,
|
||||
type: types[priv],
|
||||
});
|
||||
}
|
||||
return states.map(function (priv) {
|
||||
const guestDisabled = ['groups:moderate', 'groups:posts:upvote', 'groups:posts:downvote', 'groups:local:login', 'groups:group:create'];
|
||||
|
||||
Reference in New Issue
Block a user