File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,11 @@ const fetchProgressDecorator = (total, fn) => {
1717 } ) ) ;
1818}
1919
20- const isFetchSupported = typeof fetch !== 'undefined ';
21- const isReadableStreamSupported = isFetchSupported && typeof ReadableStream !== 'undefined ';
20+ const isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function ';
21+ const isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function ';
2222
2323// used only inside the fetch adapter
24- const encodeText = isFetchSupported && ( typeof TextEncoder !== 'undefined ' ?
24+ const encodeText = isFetchSupported && ( typeof TextEncoder === 'function ' ?
2525 ( ( encoder ) => ( str ) => encoder . encode ( str ) ) ( new TextEncoder ( ) ) :
2626 async ( str ) => new Uint8Array ( await new Response ( str ) . arrayBuffer ( ) )
2727) ;
You can’t perform that action at this time.
0 commit comments