File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 66
77var isArray = require ( 'isarray' ) ;
88var isBuf = require ( './is-buffer' ) ;
9+ 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]' ;
912
1013/**
1114 * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
@@ -97,8 +100,8 @@ exports.removeBlobs = function(data, callback) {
97100 if ( ! obj ) return obj ;
98101
99102 // convert any blob
100- if ( ( typeof global . Blob === 'function' && obj instanceof Blob ) ||
101- ( typeof global . File === 'function' && obj instanceof File ) ) {
103+ if ( ( withNativeBlob && obj instanceof Blob ) ||
104+ ( withNativeFile && obj instanceof File ) ) {
102105 pendingBlobs ++ ;
103106
104107 // async filereader
You can’t perform that action at this time.
0 commit comments