MCPcopy Create free account
hub / github.com/getsentry/XcodeBuildMCP / mergeDefinition

Function mergeDefinition

src/core/structured-output-schema.ts:138–150  ·  view source on GitHub ↗
(targetDefs: JsonObject, name: string, definition: unknown)

Source from the content-addressed store, hash-verified

136}
137
138function mergeDefinition(targetDefs: JsonObject, name: string, definition: unknown): void {
139 const existing = targetDefs[name];
140 if (existing === undefined) {
141 targetDefs[name] = definition;
142 return;
143 }
144
145 if (stableStringify(existing) !== stableStringify(definition)) {
146 throw new Error(
147 `Conflicting local $defs entry while bundling structured output schema: ${name}`,
148 );
149 }
150}
151
152function bundleSchema(rootSchema: JsonObject, commonSchema: JsonObject): JsonObject {
153 if (typeof rootSchema.$id !== 'string' || rootSchema.$id.length === 0) {

Callers 2

bundleSchemaFunction · 0.85

Calls 1

stableStringifyFunction · 0.70

Tested by

no test coverage detected