zxing-js / library

Multi-format 1D/2D barcode image processing library, usable in JavaScript ecosystem.
https://zxing-js.github.io/library/
Apache License 2.0
2.51k stars 547 forks source link

[WARNING] Comparison with NaN using the "===" operator here is always false #553

Closed 03juan closed 1 year ago

03juan commented 1 year ago

https://github.com/zxing-js/library/blob/c6b4a70996e65f0c1ba315d3052726bb385b811c/src/core/common/detector/MathUtils.ts#L36

I got this error message when importing an upstream library and didn't see an issue about it here.

[WARNING] Comparison with NaN using the "===" operator here is always false

vendor/html5-qrcode-2.3.4/html5-qrcode-2.3.4/third_party/zxing-js.umd.js:5069:20:
  5069 │             if (NaN === d)
       ╵                     ~~~

Floating-point equality is defined such that NaN is never equal to anything, so "x === NaN" always returns false. You need to use "isNaN(x)" instead to test for NaN.

werthdavid commented 1 year ago

plz try 0.19.3