MCPcopy Create free account
hub / github.com/apache/maka / stableStringify

Function stableStringify

scripts/computer-use/trace-analyse.mjs:70–77  ·  view source on GitHub ↗

JSON with object keys in sorted order, at every depth.

(value)

Source from the content-addressed store, hash-verified

68
69/** JSON with object keys in sorted order, at every depth. */
70function stableStringify(value) {
71 if (Array.isArray(value)) return `[${value.map(stableStringify).join(',')}]`;
72 if (value && typeof value === 'object') {
73 const keys = Object.keys(value).sort();
74 return `{${keys.map((k) => `${JSON.stringify(k)}:${stableStringify(value[k])}`).join(',')}}`;
75 }
76 return JSON.stringify(value) ?? 'null';
77}
78
79/**
80 * Which window of which application a call is aimed at.

Callers 11

selectedSourceTextFunction · 0.90
runtimeEventArchiveBodyFunction · 0.90
runtimeEventSearchTextFunction · 0.90
stableSynthesisBlockIdFunction · 0.90
replayAgentGraphRecordsFunction · 0.90
signatureFunction · 0.70

Calls 2

joinMethod · 0.80
keysMethod · 0.80

Tested by

no test coverage detected