max-mapper / websocket-stream

websockets with the node stream API
BSD 2-Clause "Simplified" License
667 stars 114 forks source link

Use typeof for checking globals #93

Closed mcollina closed 8 years ago

mcollina commented 8 years ago

Fixes #92.

@sandro-k @mafintosh @binarykitchen please check.

sandro-k commented 8 years ago

@mcollina 👍 that should definitely work, I had that in PR before but checked Safari, Chrome and Firefox for WebSocket and they all had it defined.

We could also be more specific in the check e.g:

typeof WebSocket === "function"