MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / _isFetchSupported

Function _isFetchSupported

packages/core/src/utils/supports.ts:76–90  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

74export const supportsFetch = _isFetchSupported;
75
76function _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

Callers 2

supportsNativeFetchFunction · 0.85
supportsReferrerPolicyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected