bireader 1.0.41 → 1.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -681,7 +681,7 @@ function wbit(_this, value, bits, unsigned, endian) {
681
681
  return;
682
682
  }
683
683
  if (bits <= 0 || bits > 32) {
684
- throw new Error('Bit length must be between 1 and 32.');
684
+ throw new Error('Bit length must be between 1 and 32. Got ' + bits);
685
685
  }
686
686
  if (unsigned == true) {
687
687
  if (value < 0 || value > Math.pow(2, bits)) {
@@ -741,7 +741,7 @@ function rbit(_this, bits, unsigned, endian) {
741
741
  return 0;
742
742
  }
743
743
  if (bits <= 0 || bits > 32) {
744
- throw new Error('Bit length must be between 1 and 32.');
744
+ throw new Error('Bit length must be between 1 and 32. Got ' + bits);
745
745
  }
746
746
  const size_needed = ((((bits - 1) + _this.bitoffset) / 8) + _this.offset);
747
747
  if (bits <= 0 || size_needed > _this.size) {