Skip to content

Commit

Permalink
fix: Object.assign (don't alter origin)
Browse files Browse the repository at this point in the history
  • Loading branch information
Khaaz committed May 12, 2020
1 parent 0a5d44a commit b165271
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/modules/Navet/commands/Navet_All.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ class All extends Command {
this.axon.navetDB.delete(e.id);
}
if (!this.module.navetDB.isExpired(e) ) {
e.username = user.username;
all.push(e);
all.push(Object.assign( { username: user.username }, e) );
}
}
const display = this.chunk(all, chunk).map( (u, i) => `${( (chunk - 1) * 10) + i + 1}) [${u.username}] - [${u.price}]`);
Expand Down
3 changes: 1 addition & 2 deletions src/modules/Navet/commands/Navet_Top.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ class Top extends Command {
this.axon.navetDB.delete(e.id);
}
if (!this.module.navetDB.isExpired(e) ) {
e.username = user.username;
top5.push(e);
top5.push(Object.assign( { username: user.username }, e) );
}
if (top5.length === 5) {
break;
Expand Down

0 comments on commit b165271

Please sign in to comment.