File tree Expand file tree Collapse file tree 3 files changed +1
-7
lines changed Expand file tree Collapse file tree 3 files changed +1
-7
lines changed Original file line number Diff line number Diff line change 5
5
6
6
var debug = require ( 'debug' ) ( 'socket.io-parser' ) ;
7
7
var Emitter = require ( 'component-emitter' ) ;
8
- var hasBin = require ( 'has-binary2' ) ;
9
8
var binary = require ( './binary' ) ;
10
9
var isArray = require ( 'isarray' ) ;
11
10
var isBuf = require ( './is-buffer' ) ;
@@ -125,10 +124,6 @@ function Encoder() {}
125
124
*/
126
125
127
126
Encoder . prototype . encode = function ( obj , callback ) {
128
- if ( ( obj . type === exports . EVENT || obj . type === exports . ACK ) && hasBin ( obj . data ) ) {
129
- obj . type = obj . type === exports . EVENT ? exports . BINARY_EVENT : exports . BINARY_ACK ;
130
- }
131
-
132
127
debug ( 'encoding packet %j' , obj ) ;
133
128
134
129
if ( exports . BINARY_EVENT === obj . type || exports . BINARY_ACK === obj . type ) {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ var withNativeBuffer = typeof global.Buffer === 'function' && typeof global.Buff
5
5
var withNativeArrayBuffer = typeof global . ArrayBuffer === 'function' ;
6
6
7
7
var isView = ( function ( ) {
8
- if ( typeof global . ArrayBuffer . isView === 'function' ) {
8
+ if ( withNativeArrayBuffer && typeof global . ArrayBuffer . isView === 'function' ) {
9
9
return global . ArrayBuffer . isView ;
10
10
} else {
11
11
return function ( obj ) { return obj . buffer instanceof global . ArrayBuffer ; } ;
Original file line number Diff line number Diff line change 14
14
"dependencies" : {
15
15
"debug" : " ~3.1.0" ,
16
16
"component-emitter" : " 1.2.1" ,
17
- "has-binary2" : " ~1.0.2" ,
18
17
"isarray" : " 2.0.1"
19
18
},
20
19
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments