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

Function hasSchemaIntent

packages/opencode/src/provider/transform.ts:1467–1486  ·  view source on GitHub ↗
(node: unknown)

Source from the content-addressed store, hash-verified

1465 const hasCombiner = (node: unknown) =>
1466 isPlainObject(node) && (Array.isArray(node.anyOf) || Array.isArray(node.oneOf) || Array.isArray(node.allOf))
1467 const hasSchemaIntent = (node: unknown) => {
1468 if (!isPlainObject(node)) return false
1469 if (hasCombiner(node)) return true
1470 return [
1471 "type",
1472 "properties",
1473 "items",
1474 "prefixItems",
1475 "enum",
1476 "const",
1477 "$ref",
1478 "additionalProperties",
1479 "patternProperties",
1480 "required",
1481 "not",
1482 "if",
1483 "then",
1484 "else",
1485 ].some((key) => key in node)
1486 }
1487
1488 const sanitizeGemini = (obj: any): any => {
1489 if (obj === null || typeof obj !== "object") {

Callers 1

sanitizeGeminiFunction · 0.70

Calls 2

isPlainObjectFunction · 0.70
hasCombinerFunction · 0.70

Tested by

no test coverage detected