gnat / surreal

🗿 Mini jQuery alternative. Dependency-free animations. Locality of Behavior. Use one element or arrays transparently. Pairs with htmx. Vanilla querySelector() but better!
https://gnat.github.io/surreal/example.html
MIT License
1.2k stars 24 forks source link

Comparison using the "===" operator here is always false #27

Closed jazoom closed 3 months ago

jazoom commented 3 months ago

I get this warning from esbuild:

▲ [WARNING] Comparison using the "===" operator here is always false [equals-new-object]

    deps/.downloaded/surreal/script.js:92:22:
      92 │     if (e === null || e === []) return null
         ╵                         ~~~

  Equality with a new object is always false in JavaScript because the equality operator tests
  object identity. You need to write code to compare the contents of the object instead. For
  example, use "Array.isArray(x) && x.length === 0" instead of "x === []" to test for an empty
  array.

I wonder if there's a particular reason you included it in there?

gnat commented 3 months ago

Thank you for the report! Resolved in 1.2.0