File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 77var isArray = require ( 'isarray' ) ;
88
99var 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' ||
11+ typeof Blob !== 'undefined' && toString . call ( Blob ) === '[object BlobConstructor]' ;
12+ var withNativeFile = typeof File === 'function' ||
13+ typeof File !== 'undefined' && toString . call ( File ) === '[object FileConstructor]' ;
1214
1315/**
1416 * Module exports.
@@ -39,11 +41,11 @@ function hasBinary (obj) {
3941 return false ;
4042 }
4143
42- if ( ( typeof global . Buffer === 'function' && global . Buffer . isBuffer && global . Buffer . isBuffer ( obj ) ) ||
43- ( typeof global . ArrayBuffer === 'function' && obj instanceof ArrayBuffer ) ||
44- ( withNativeBlob && obj instanceof Blob ) ||
45- ( withNativeFile && obj instanceof File )
46- ) {
44+ if ( ( typeof Buffer === 'function' && Buffer . isBuffer && Buffer . isBuffer ( obj ) ) ||
45+ ( typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer ) ||
46+ ( withNativeBlob && obj instanceof Blob ) ||
47+ ( withNativeFile && obj instanceof File )
48+ ) {
4749 return true ;
4850 }
4951
You can’t perform that action at this time.
0 commit comments