MCPcopy Create free account
hub / github.com/agentrpc/agentrpc / buildZodProp

Function buildZodProp

sdk-node/src/bin.ts:118–132  ·  view source on GitHub ↗
(prop: any, key: string)

Source from the content-addressed store, hash-verified

116
117// @eslint-disable-next-line
118const buildZodProp = (prop: any, key: string): ZodTypeAny => {
119 if (prop.type === "string") {
120 return z.string();
121 } else if (prop.type === "number") {
122 return z.number();
123 } else if (prop.type === "boolean") {
124 return z.boolean();
125 } else if (prop.type === "object") {
126 return z.object(buildZodObject(prop));
127 } else if (prop.type === "array") {
128 return z.array(buildZodProp(prop.items, key));
129 } else {
130 return z.any();
131 }
132};

Callers 1

buildZodObjectFunction · 0.85

Calls 1

buildZodObjectFunction · 0.85

Tested by

no test coverage detected