File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
var isArray = require ( 'isarray' ) ;
8
8
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]' ;
12
+
9
13
/**
10
14
* Module exports.
11
15
*/
@@ -37,8 +41,8 @@ function hasBinary (obj) {
37
41
38
42
if ( ( typeof global . Buffer === 'function' && global . Buffer . isBuffer && global . Buffer . isBuffer ( obj ) ) ||
39
43
( typeof global . ArrayBuffer === 'function' && obj instanceof ArrayBuffer ) ||
40
- ( typeof global . Blob === 'function' && obj instanceof Blob ) ||
41
- ( typeof global . File === 'function' && obj instanceof File )
44
+ ( withNativeBlob && obj instanceof Blob ) ||
45
+ ( withNativeFile && obj instanceof File )
42
46
) {
43
47
return true ;
44
48
}
You can’t perform that action at this time.
0 commit comments