Skip to content

Commit

Permalink
fix: resolving string bitfield (#9262)
Browse files Browse the repository at this point in the history
fix: resolving bitfield

Co-authored-by: space <spaceeec@yahoo.com>
  • Loading branch information
2 people authored and Jiralite committed Apr 1, 2023
1 parent ea1b0eb commit 630d4f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/BitField.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ class BitField {
if (bit instanceof BitField) return bit.bitfield;
if (Array.isArray(bit)) return bit.map(p => this.resolve(p)).reduce((prev, p) => prev | p, defaultBit);
if (typeof bit === 'string') {
if (typeof this.FLAGS[bit] !== 'undefined') return this.FLAGS[bit];
if (!isNaN(bit)) return typeof defaultBit === 'bigint' ? BigInt(bit) : Number(bit);
if (this.FLAGS[bit] !== undefined) return this.FLAGS[bit];
}
throw new RangeError('BITFIELD_INVALID', bit);
}
Expand Down

0 comments on commit 630d4f3

Please sign in to comment.