()
| 74 | export const supportsFetch = _isFetchSupported; |
| 75 | |
| 76 | function _isFetchSupported(): boolean { |
| 77 | if (!('fetch' in WINDOW)) { |
| 78 | return false; |
| 79 | } |
| 80 | |
| 81 | try { |
| 82 | new Headers(); |
| 83 | // Deno requires a valid URL so '' cannot be used as an argument |
| 84 | new Request('data:,'); |
| 85 | new Response(); |
| 86 | return true; |
| 87 | } catch { |
| 88 | return false; |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * isNative checks if the given function is a native implementation |
no outgoing calls
no test coverage detected