sanctuary-js / sanctuary-def

Run-time type system for JavaScript
MIT License
294 stars 23 forks source link

use `globalThis` and `?.` operator to simplify feature detection #322

Closed davidchambers closed 6 months ago

davidchambers commented 6 months ago

I find globalThis.Foo != null clearer than typeof Foo !== 'undefined' && Foo != null, and it has the added benefit of not concerning ESLint.