MCPcopy Index your code
hub / github.com/github/copilot-sdk / dedupeGoSchemasForMatch

Function dedupeGoSchemasForMatch

scripts/codegen/go.ts:2130–2140  ·  view source on GitHub ↗
(schemas: JSONSchema7[], ctx: GoCodegenCtx)

Source from the content-addressed store, hash-verified

2128}
2129
2130function dedupeGoSchemasForMatch(schemas: JSONSchema7[], ctx: GoCodegenCtx): JSONSchema7[] {
2131 const seen = new Set<string>();
2132 const result: JSONSchema7[] = [];
2133 for (const schema of schemas) {
2134 const key = stableStringify(normalizeSchemaForMatch(schema, ctx));
2135 if (seen.has(key)) continue;
2136 seen.add(key);
2137 result.push(schema);
2138 }
2139 return result;
2140}
2141
2142function goDefinitionRefForEquivalentSchema(schema: JSONSchema7, ctx: GoCodegenCtx): string | undefined {
2143 const schemaKey = stableStringify(normalizeSchemaForMatch(schema, ctx));

Callers 1

Calls 4

normalizeSchemaForMatchFunction · 0.85
stableStringifyFunction · 0.70
addMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…