MCPcopy Create free account
hub / github.com/Superflows-AI/superflows / isValidBody

Function isValidBody

supabase/functions/execute-code/index.ts:107–118  ·  view source on GitHub ↗
(
  body: any,
  bodySchema: z.ZodType<any>,
)

Source from the content-addressed store, hash-verified

105});
106
107export function isValidBody<T extends Record<string, unknown>>(
108 body: any,
109 bodySchema: z.ZodType<any>,
110): body is T {
111 const safeParseOut = bodySchema.safeParse(body);
112 if ("error" in safeParseOut) {
113 console.error(
114 "Error parsing request body: " + safeParseOut.error.toString(),
115 );
116 }
117 return safeParseOut.success;
118}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected