for(const key of Object.keys(items)) {
if(items[key].stage == 2) {
this.client.srem('items', key);
this.emit('itemGv', items[key]);
} else if(trades[key].stage == 5) {
this.client.srem('items', key);
this.emit('itemTm', items[key]);
}
}
const STAGES = {
2: 'itemGv',
5: 'itemTm',
};
for (const [ key, val ] of Object.entries(items)) {
const s = STAGES[val.stage];
if (s) {
this.client.srem('items', key);
this.emit(s, val);
}
}