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

Function isEmptyStructUnion

packages/opencode/src/tool/json-schema.ts:102–108  ·  view source on GitHub ↗
(items: unknown[])

Source from the content-addressed store, hash-verified

100}
101
102function isEmptyStructUnion(items: unknown[]) {
103 return (
104 items.length === 2 &&
105 items.some((item) => isRecord(item) && item.type === "object" && item.properties === undefined) &&
106 items.some((item) => isRecord(item) && item.type === "array" && item.items === undefined)
107 )
108}
109
110function canFlattenAllOf(allOf: JsonObject[], parent: JsonObject) {
111 const keys = new Set(Object.keys(parent).filter((key) => key !== "allOf"))

Callers 1

normalizeFunction · 0.85

Calls 1

isRecordFunction · 0.70

Tested by

no test coverage detected