MCPcopy Index your code
hub / github.com/simstudioai/sim / parseOptionalSchema

Function parseOptionalSchema

apps/sim/lib/api/client/request.ts:118–124  ·  view source on GitHub ↗
(
  schema: S,
  value: unknown
)

Source from the content-addressed store, hash-verified

116}
117
118function parseOptionalSchema<S extends ApiSchema | undefined>(
119 schema: S,
120 value: unknown
121): EmptySchemaOutput<S> {
122 if (!schema) return undefined as EmptySchemaOutput<S>
123 return schema.parse(value) as EmptySchemaOutput<S>
124}
125
126async function readResponseBody(response: Response): Promise<{ parsed: unknown; raw?: string }> {
127 const text = await response.text()

Callers 2

requestJsonFunction · 0.85
requestRawFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected