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

Function stableStringify

scripts/codegen/go.ts:2086–2095  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

2084}
2085
2086function stableStringify(value: unknown): string {
2087 if (Array.isArray(value)) {
2088 return `[${value.map((item) => stableStringify(item)).join(",")}]`;
2089 }
2090 if (value && typeof value === "object") {
2091 const entries = Object.entries(value as Record<string, unknown>).sort(([a], [b]) => a.localeCompare(b));
2092 return `{${entries.map(([key, entryValue]) => `${JSON.stringify(key)}:${stableStringify(entryValue)}`).join(",")}}`;
2093 }
2094 return JSON.stringify(value);
2095}
2096
2097function normalizeSchemaForMatch(schema: JSONSchema7, ctx: GoCodegenCtx): unknown {
2098 const resolved = resolveSchema(schema, ctx.definitions) ?? schema;

Callers 5

normalizeSchemaForMatchFunction · 0.70
dedupeGoSchemasForMatchFunction · 0.70
generateGoRpcTypeCodeFunction · 0.70

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…