MCPcopy
hub / github.com/colinhacks/zod / cleanParams

Function cleanParams

packages/zod/src/v3/types.ts:4908–4913  ·  view source on GitHub ↗
(params: unknown, data: unknown)

Source from the content-addressed store, hash-verified

4906////////////////////////////////////////
4907////////////////////////////////////////
4908function cleanParams(params: unknown, data: unknown) {
4909 const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
4910
4911 const p2 = typeof p === "string" ? { message: p } : p;
4912 return p2;
4913}
4914type CustomParams = CustomErrorParams & { fatal?: boolean };
4915export function custom<T>(
4916 check?: (data: any) => any,

Callers 1

customFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected