I think there is an issue in the instanceof check.
I keep getting an warning message like this in my bundler where imported this library:
▲ [WARNING] Suspicious use of the "!" operator inside the "instanceof" operator [suspicious-boolean-not]
.wrangler/tmp/pages-GVXi9w/bundledWorker-0.2874780651986786.mjs:31392:16:
31392 │ if (!inputRef.current instanceof HTMLInputElement)
│ ~~~~~~~~~~~~~~~~~
╵ (!inputRef.current)
Right now !inputRef.current is evaluated first to either true or false, and true instanceof HTMLInputElement and false instanceof HTMLInputElement would both evaluate to false, so I think this code will not trigger at all at the moment.
For extra confirmation I tried plugging it into ASTExplorer which also showed that !inputRef.current is evaluated as one unit:
I just created this PR in the GitHub web interface, not sure if that will suffice to be ready to merge. Let me know if you'd need anything from me. Thanks!
I think there is an issue in the instanceof check.
I keep getting an warning message like this in my bundler where imported this library:
Right now
!inputRef.current
is evaluated first to eithertrue
orfalse
, andtrue instanceof HTMLInputElement
andfalse instanceof HTMLInputElement
would both evaluate tofalse
, so I think this code will not trigger at all at the moment.For extra confirmation I tried plugging it into ASTExplorer which also showed that
!inputRef.current
is evaluated as one unit:I just created this PR in the GitHub web interface, not sure if that will suffice to be ready to merge. Let me know if you'd need anything from me. Thanks!