MCPcopy Create free account
hub / github.com/Effect-TS/effect / create

Function create

packages/effect/test/httpapi/HttpApiClient.test.ts:191–200  ·  view source on GitHub ↗
(api: HttpApi.HttpApi<"Api", typeof Group>)

Source from the content-addressed store, hash-verified

189 }
190 const requests: Array<{ readonly url: string; readonly headers: Record<string, string> }> = []
191 const create = (api: HttpApi.HttpApi<"Api", typeof Group>) =>
192 HttpApiClient.makeWith(api, {
193 baseUrl: "http://test",
194 httpClient: HttpClient.make((request, url) =>
195 Effect.sync(() => {
196 requests.push({ url: url.toString(), headers: request.headers })
197 return HttpClientResponse.fromWeb(request, new Response(null, { status: 204 }))
198 })
199 )
200 }).pipe(Effect.flatMap((client) => Effect.exit(client.test.create(request))), Effect.map(String))
201
202 // Encoded in order: params, payload, headers, query.
203 let api = HttpApi.make("Api").add(Group)

Callers 1

Calls 7

exitMethod · 0.80
pipeMethod · 0.65
makeMethod · 0.65
pushMethod · 0.65
toStringMethod · 0.65
syncMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected