MCPcopy
hub / github.com/TanStack/ai / resolveRef

Function resolveRef

packages/ai-code-mode/src/validate-bindings.ts:81–90  ·  view source on GitHub ↗
(
  ref: string,
  root: JsonSchemaLike,
)

Source from the content-addressed store, hash-verified

79}
80
81function resolveRef(
82 ref: string,
83 root: JsonSchemaLike,
84): JsonSchemaLike | undefined {
85 const match = ref.match(/^#\/(\$defs|definitions)\/(.+)$/)
86 if (!match) return undefined
87 const bucket = match[1] as '$defs' | 'definitions'
88 const key = match[2]
89 return key === undefined ? undefined : root[bucket]?.[key]
90}
91
92function findSecretParams(
93 schema: JsonSchemaLike | undefined,

Callers 1

findSecretParamsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected