bireader 1.0.58 → 1.0.59

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/esm/index.mjs CHANGED
@@ -1222,11 +1222,12 @@ function rfloat(_this, endian) {
1222
1222
  }
1223
1223
  function wfloat(_this, value, endian) {
1224
1224
  check_size(_this, 4, 0);
1225
- const MIN_POSITIVE_FLOAT32 = 1.17549435e-38;
1225
+ const MIN_POSITIVE_FLOAT32 = Number.MIN_VALUE;
1226
1226
  const MAX_POSITIVE_FLOAT32 = 3.4028235e+38;
1227
1227
  const MIN_NEGATIVE_FLOAT32 = -3.4028235e+38;
1228
- const MAX_NEGATIVE_FLOAT32 = -1.17549435e-38;
1229
- if (!((value === 0) || (value >= MIN_POSITIVE_FLOAT32 && value <= MAX_POSITIVE_FLOAT32) ||
1228
+ const MAX_NEGATIVE_FLOAT32 = -Number.MIN_VALUE;
1229
+ if (!((value === 0) ||
1230
+ (value >= MIN_POSITIVE_FLOAT32 && value <= MAX_POSITIVE_FLOAT32) ||
1230
1231
  (value >= MIN_NEGATIVE_FLOAT32 && value <= MAX_NEGATIVE_FLOAT32))) {
1231
1232
  _this.errorDump ? "[Error], hexdump:\n" + _this.hexdump() : "";
1232
1233
  throw new Error('Value is out of range for the specified float length.' + " min: " + MIN_NEGATIVE_FLOAT32 + " max: " + MAX_POSITIVE_FLOAT32 + " value: " + value);
@@ -1333,8 +1334,8 @@ function wint64(_this, value, unsigned, endian) {
1333
1334
  function wdfloat(_this, value, endian) {
1334
1335
  check_size(_this, 8, 0);
1335
1336
  const MIN_POSITIVE_FLOAT64 = 2.2250738585072014e-308;
1336
- const MAX_POSITIVE_FLOAT64 = 1.7976931348623157e+308;
1337
- const MIN_NEGATIVE_FLOAT64 = -1.7976931348623157e+308;
1337
+ const MAX_POSITIVE_FLOAT64 = Number.MAX_VALUE;
1338
+ const MIN_NEGATIVE_FLOAT64 = -Number.MAX_VALUE;
1338
1339
  const MAX_NEGATIVE_FLOAT64 = -2.2250738585072014e-308;
1339
1340
  if (!((value === 0) ||
1340
1341
  (value >= MIN_POSITIVE_FLOAT64 && value <= MAX_POSITIVE_FLOAT64) ||