MCPcopy
hub / github.com/tldraw/tldraw / fetch

Function fetch

packages/utils/src/lib/network.ts:9–16  ·  view source on GitHub ↗
(input: RequestInfo | URL, init?: RequestInit)

Source from the content-addressed store, hash-verified

7 * @internal
8 */
9export async function fetch(input: RequestInfo | URL, init?: RequestInit): Promise<Response> {
10 // eslint-disable-next-line tldraw/no-restricted-properties
11 return window.fetch(input, {
12 // We want to make sure that the referrer is not sent to other domains.
13 referrerPolicy: 'strict-origin-when-cross-origin',
14 ...init,
15 })
16}
17
18/**
19 * Just a wrapper around `new Image`, and yeah, it's a bit strange that it's in the network.ts file

Callers 15

network.test.tsFile · 0.90
urlToArrayBufferMethod · 0.90
urlToBlobMethod · 0.90
dataUrlToFileFunction · 0.90
fetchCacheFunction · 0.90
shouldRequireConsentFunction · 0.90
preloadMethod · 0.90
uploadTldrFileMethod · 0.90
acceptWorkspaceInviteMethod · 0.90
trackStarterKitChoiceFunction · 0.50
downloadTemplateFunction · 0.50

Calls 1

fetchMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…