A bit less to write.
The bitfield module lets you easily work with bitfield values, instead of working with actual bits, errors-bitfield
uses positions, Meaning that you only enable or disable positions and not bits.
yarn add errors-bitfield
// import
import Bitfield from "errors-bitfield";
const bits = new Bitfield();
bits.add(1, 3, 5);
console.log(bits.bit); // 21
bits.remove(5);
console.log(bits.bit); // 5