Skip to content

Commit cff7cc3

Browse files
committed
require check added, fixes #62
1 parent 88b6e88 commit cff7cc3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

angular-websocket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
}
347347

348348
// CommonJS
349-
if (typeof exports === 'object' && require) {
349+
if (typeof exports === 'object' && typeof require === 'function') {
350350
try {
351351
ws = require('ws');
352352
Socket = (ws.Client || ws.client || ws);

dist/angular-websocket.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
}
347347

348348
// CommonJS
349-
if (typeof exports === 'object' && require) {
349+
if (typeof exports === 'object' && typeof require === 'function') {
350350
try {
351351
ws = require('ws');
352352
Socket = (ws.Client || ws.client || ws);

0 commit comments

Comments
 (0)