MCPcopy
hub / github.com/unjs/ofetch / callHooks

Function callHooks

src/utils.ts:140–153  ·  view source on GitHub ↗
(
  context: C,
  hooks: FetchHook<C> | FetchHook<C>[] | undefined
)

Source from the content-addressed store, hash-verified

138}
139
140export async function callHooks<C extends FetchContext = FetchContext>(
141 context: C,
142 hooks: FetchHook<C> | FetchHook<C>[] | undefined
143): Promise<void> {
144 if (hooks) {
145 if (Array.isArray(hooks)) {
146 for (const hook of hooks) {
147 await hook(context);
148 }
149 } else {
150 await hooks(context);
151 }
152 }
153}

Callers 1

$fetchRawFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…