MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / deepResolve

Function deepResolve

packages/react/src/components/schema-explorer.tsx:67–77  ·  view source on GitHub ↗
(schema: JsonSchema, root: JsonSchema)

Source from the content-addressed store, hash-verified

65 * oneOf/anyOf so we can inspect the concrete shape.
66 */
67const deepResolve = (schema: JsonSchema, root: JsonSchema): JsonSchema => {
68 let s = schema;
69 if (s.$ref) {
70 const resolved = resolveRef(s.$ref, root);
71 if (resolved) s = resolved;
72 }
73 // Unwrap single-variant unions
74 if (s.oneOf?.length === 1) s = deepResolve(s.oneOf[0]!, root);
75 if (s.anyOf?.length === 1) s = deepResolve(s.anyOf[0]!, root);
76 return s;
77};
78
79// ---------------------------------------------------------------------------
80// Type label — human readable, shows ref names

Callers 4

getChildCountFunction · 0.70
mergeAllOfFunction · 0.70
PropertyChildrenFunction · 0.70
countTopLevelFieldsFunction · 0.70

Calls 1

resolveRefFunction · 0.70

Tested by

no test coverage detected