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

Function resolveRef

packages/react/src/components/schema-explorer.tsx:55–59  ·  view source on GitHub ↗
(ref: string, root: JsonSchema)

Source from the content-addressed store, hash-verified

53// ---------------------------------------------------------------------------
54
55const resolveRef = (ref: string, root: JsonSchema): JsonSchema | null => {
56 const name = ref.match(/^#\/\$defs\/(.+)$/)?.[1];
57 if (!name || !root.$defs) return null;
58 return root.$defs[name] ?? null;
59};
60
61const getRefName = (ref: string): string | undefined => ref.match(/^#\/\$defs\/(.+)$/)?.[1];
62

Callers 2

deepResolveFunction · 0.70
PropertyRowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected