MCPcopy Create free account
hub / github.com/anomalyco/opencode / hasLocalReference

Function hasLocalReference

packages/opencode/src/tool/json-schema.ts:152–162  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

150}
151
152function hasLocalReference(value: unknown): boolean {
153 if (Array.isArray(value)) return value.some(hasLocalReference)
154 if (!isRecord(value)) return false
155 if (
156 typeof value.$ref === "string" &&
157 (value.$ref.startsWith("#/$defs/") || value.$ref.startsWith("#/definitions/"))
158 ) {
159 return true
160 }
161 return Object.values(value).some(hasLocalReference)
162}
163
164export * as ToolJsonSchema from "./json-schema"

Callers 1

Calls 2

isRecordFunction · 0.70
valuesMethod · 0.45

Tested by

no test coverage detected