MCPcopy Create free account
hub / github.com/ShipSecAI/studio / getObjectShape

Function getObjectShape

packages/component-sdk/src/json-schema.ts:41–47  ·  view source on GitHub ↗
(schema: z.ZodTypeAny)

Source from the content-addressed store, hash-verified

39}
40
41function getObjectShape(schema: z.ZodTypeAny): Record<string, z.ZodTypeAny> {
42 const shape = (schema as any).shape;
43 if (typeof shape === 'function') {
44 return shape();
45 }
46 return shape ?? {};
47}
48
49/**
50 * Generate JSON schema from Zod schema

Callers 1

zodToJsonSchemaFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected