(value: unknown)
| 2084 | } |
| 2085 | |
| 2086 | function 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 | |
| 2097 | function normalizeSchemaForMatch(schema: JSONSchema7, ctx: GoCodegenCtx): unknown { |
| 2098 | const resolved = resolveSchema(schema, ctx.definitions) ?? schema; |
no test coverage detected
searching dependent graphs…