File tree Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Expand file tree Collapse file tree 4 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 11{
22 "extends": "eslint-config-airbnb-base",
33 "env": {
4- "browser": true,
54 "node": true
65 },
76 "rules": {
Original file line number Diff line number Diff line change 9797 "utfstring" : " ^2.0.0"
9898 },
9999 "jest" : {
100- "globals" : {
101- "navigator" : true
102- },
103100 "testEnvironment" : " node" ,
104101 "testMatch" : [
105102 " **/test/*.js?(x)" ,
Original file line number Diff line number Diff line change @@ -134,14 +134,19 @@ export function serializeHeaders(headers = {}) {
134134 return obj
135135}
136136
137- export function isFile ( obj , navigatorObj = navigator ) {
137+ export function isFile ( obj , navigatorObj ) {
138+ if ( ! navigatorObj && typeof navigator !== 'undefined' ) {
139+ // eslint-disable-next-line no-undef
140+ navigatorObj = navigator
141+ }
138142 if ( navigatorObj && navigatorObj . product === 'ReactNative' ) {
139143 if ( obj && typeof obj === 'object' && typeof obj . uri === 'string' ) {
140144 return true
141145 }
142146 return false
143147 }
144148 if ( typeof File !== 'undefined' ) {
149+ // eslint-disable-next-line no-undef
145150 return obj instanceof File
146151 }
147152 return obj !== null && typeof obj === 'object' && typeof obj . pipe === 'function'
Original file line number Diff line number Diff line change @@ -436,7 +436,8 @@ describe('http', () => {
436436 const mockReactNativeNavigator = {
437437 product : 'ReactNative'
438438 }
439- const browserFile = new File ( )
439+
440+ const browserFile = new global . File ( )
440441 const reactNativeFileObject = {
441442 uri : '/mock/path'
442443 }
You can’t perform that action at this time.
0 commit comments