From cff7cc3e579abbf0a7614e9e827be84e33239352 Mon Sep 17 00:00:00 2001 From: raszpi Date: Mon, 7 Mar 2016 08:00:42 -0500 Subject: [PATCH] require check added, fixes #62 --- angular-websocket.js | 2 +- dist/angular-websocket.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-websocket.js b/angular-websocket.js index 04e24a9..85b294a 100644 --- a/angular-websocket.js +++ b/angular-websocket.js @@ -346,7 +346,7 @@ } // CommonJS - if (typeof exports === 'object' && require) { + if (typeof exports === 'object' && typeof require === 'function') { try { ws = require('ws'); Socket = (ws.Client || ws.client || ws); diff --git a/dist/angular-websocket.js b/dist/angular-websocket.js index 04e24a9..85b294a 100644 --- a/dist/angular-websocket.js +++ b/dist/angular-websocket.js @@ -346,7 +346,7 @@ } // CommonJS - if (typeof exports === 'object' && require) { + if (typeof exports === 'object' && typeof require === 'function') { try { ws = require('ws'); Socket = (ws.Client || ws.client || ws);