File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55
66var debug = require ( 'debug' ) ( 'socket.io-parser' ) ;
77var Emitter = require ( 'component-emitter' ) ;
8- var hasBin = require ( 'has-binary2' ) ;
98var binary = require ( './binary' ) ;
109var isArray = require ( 'isarray' ) ;
1110var isBuf = require ( './is-buffer' ) ;
@@ -125,10 +124,6 @@ function Encoder() {}
125124 */
126125
127126Encoder . 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-
132127 debug ( 'encoding packet %j' , obj ) ;
133128
134129 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
55var withNativeArrayBuffer = typeof global . ArrayBuffer === 'function' ;
66
77var isView = ( function ( ) {
8- if ( typeof global . ArrayBuffer . isView === 'function' ) {
8+ if ( withNativeArrayBuffer && typeof global . ArrayBuffer . isView === 'function' ) {
99 return global . ArrayBuffer . isView ;
1010 } else {
1111 return function ( obj ) { return obj . buffer instanceof global . ArrayBuffer ; } ;
Original file line number Diff line number Diff line change 1414 "dependencies" : {
1515 "debug" : " ~3.1.0" ,
1616 "component-emitter" : " 1.2.1" ,
17- "has-binary2" : " ~1.0.2" ,
1817 "isarray" : " 2.0.1"
1918 },
2019 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments