(value: unknown)
| 150 | } |
| 151 | |
| 152 | function 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 | |
| 164 | export * as ToolJsonSchema from "./json-schema" |
no test coverage detected