Comparing version 3.0.0 to 3.1.1
15
index.js
var es = require('event-stream') | ||
, extend = require('xtend') | ||
@@ -34,4 +35,14 @@ function MuxDemux (opts, onConnection) { | ||
} | ||
else if (event === 'error') | ||
s.emit('error', data[1]) | ||
else if (event === 'error') { | ||
var error = data[1] | ||
if (typeof error === 'string') { | ||
s.emit('error', new Error(error)) | ||
} else if (typeof error.message === 'string') { | ||
var e = new Error(error.message) | ||
extend(e, error) | ||
s.emit('error', e) | ||
} else { | ||
s.emit('error', error) | ||
} | ||
} | ||
else { | ||
@@ -38,0 +49,0 @@ s.emit.apply(s, data) |
{ | ||
"name": "mux-demux", | ||
"version": "3.0.0", | ||
"version": "3.1.1", | ||
"description": "", | ||
@@ -11,3 +11,4 @@ "homepage": "http://github.com/dominictarr/mux-demux", | ||
"dependencies": { | ||
"event-stream": "~2.2" | ||
"event-stream": "~2.2", | ||
"xtend": "~1.0.3" | ||
}, | ||
@@ -14,0 +15,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
21551
650
119
2
+ Addedxtend@~1.0.3
+ Addedxtend@1.0.3(transitive)