MCPcopy Create free account
hub / github.com/vercel/vercel / fetch

Function fetch

packages/cli/src/util/fetch.ts:50–71  ·  view source on GitHub ↗
(
  input: RequestInfo,
  init?: RequestInit
)

Source from the content-addressed store, hash-verified

48}
49
50export default function fetch(
51 input: RequestInfo,
52 init?: RequestInit
53): Promise<Response> {
54 const options = { ...init } as RequestInit & {
55 dispatcher?: FetchDispatcher;
56 duplex?: 'half';
57 };
58
59 if (fetchDispatcher) {
60 options.dispatcher = fetchDispatcher;
61 }
62
63 if (init?.body instanceof Readable) {
64 options.duplex = 'half';
65 }
66
67 return globalThis.fetch(
68 input,
69 options as unknown as NativeRequestInit
70 ) as Promise<Response>;
71}
72
73/**
74 * Like {@link fetch}, but never applies the global proxy-aware dispatcher.

Callers 15

discoveryEndpointRequestFunction · 0.70
deviceAccessTokenRequestFunction · 0.70
revocationRequestFunction · 0.70
refreshTokenRequestFunction · 0.70
inspectTokenRequestFunction · 0.70
_fetchMethod · 0.70
_fetchMethod · 0.70
mintProjectOidcTokenFunction · 0.50
ensureRepositoryFunction · 0.50
probe.jsFile · 0.50
checkStreamingFunction · 0.50

Calls 1

fetchMethod · 0.45

Tested by 15

fetchHostFunction · 0.40
requestFunction · 0.40
checkForChangeFunction · 0.40
propsFromHtmlFunction · 0.40
checkForChangeFunction · 0.40
checkForChangeFunction · 0.40
checkPathsFunction · 0.40
getPropsFunction · 0.40
getInitialDataFunction · 0.40
propsFromHtmlFunction · 0.40
revalidateFunction · 0.40
checkForChangeFunction · 0.40