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

Function stableStringify

packages/opencode/src/acp/service.ts:1020–1027  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

1018}
1019
1020function stableStringify(value: unknown): string {
1021 if (Array.isArray(value)) return `[${value.map(stableStringify).join(",")}]`
1022 if (!value || typeof value !== "object") return JSON.stringify(value)
1023 return `{${Object.entries(value)
1024 .toSorted(([a], [b]) => a.localeCompare(b))
1025 .map(([key, item]) => `${JSON.stringify(key)}:${stableStringify(item)}`)
1026 .join(",")}}`
1027}
1028
1029function restoreFromMessages(messages: readonly MessageInfo[]) {
1030 const user = messages.findLast(

Callers 1

mcpRegistrationKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected