MCPcopy
hub / github.com/Effect-TS/effect / schemaToResponse

Function schemaToResponse

packages/platform/src/HttpApiClient.ts:416–422  ·  view source on GitHub ↗
(
  ast: AST.AST
)

Source from the content-addressed store, hash-verified

414}
415
416const schemaToResponse = (
417 ast: AST.AST
418): (response: HttpClientResponse.HttpClientResponse) => Effect.Effect<any, any> => {
419 const encoding = HttpApiSchema.getEncoding(ast)
420 const decode = Schema.decode(schemaFromArrayBuffer(ast, encoding))
421 return (response) => Effect.flatMap(response.arrayBuffer, decode)
422}
423
424const Uint8ArrayFromArrayBuffer = Schema.transform(
425 Schema.Unknown as Schema.Schema<ArrayBuffer>,

Callers 1

onEndpointFunction · 0.70

Calls 2

schemaFromArrayBufferFunction · 0.85
decodeMethod · 0.80

Tested by

no test coverage detected