[fix] Remove any reference to the `global` variable · socketio/socket.io-parser@b47efb2

Original file line numberDiff line numberDiff line change

@@ -7,8 +7,8 @@

77

var isArray = require('isarray');

88

var isBuf = require('./is-buffer');

99

var toString = Object.prototype.toString;

10-

var withNativeBlob = typeof global.Blob === 'function' || toString.call(global.Blob) === '[object BlobConstructor]';

11-

var withNativeFile = typeof global.File === 'function' || toString.call(global.File) === '[object FileConstructor]';

10+

var withNativeBlob = typeof Blob === 'function' || (typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]');

11+

var withNativeFile = typeof File === 'function' || (typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]');

1212
1313

/**

1414

* Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.