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 7
7
var isArray = require ( 'isarray' ) ;
8
8
9
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]' ;
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]' ;
12
14
13
15
/**
14
16
* Module exports.
@@ -39,11 +41,11 @@ function hasBinary (obj) {
39
41
return false ;
40
42
}
41
43
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
+ ) {
47
49
return true ;
48
50
}
49
51
You can’t perform that action at this time.
0 commit comments