mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-20 05:23:31 +01:00
fix(BitField): remove for..in in favor of Object.entries (#3650)
* fix(BitField): remove for..in in favor of Object.keys * refactor: do not re-resolve bits Co-Authored-By: bdistin <bdistin@gmail.com> Co-authored-by: bdistin <bdistin@gmail.com>
This commit is contained in:
@@ -103,7 +103,7 @@ class BitField {
|
|||||||
*/
|
*/
|
||||||
serialize(...hasParams) {
|
serialize(...hasParams) {
|
||||||
const serialized = {};
|
const serialized = {};
|
||||||
for (const perm in this.constructor.FLAGS) serialized[perm] = this.has(perm, ...hasParams);
|
for (const [flag, bit] of Object.entries(this.constructor.FLAGS)) serialized[flag] = this.has(bit, ...hasParams);
|
||||||
return serialized;
|
return serialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user