MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / stableStringify

Function stableStringify

scripts/bench-ci-compare.mjs:168–177  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

166}
167
168function stableStringify(value) {
169 if (Array.isArray(value)) {
170 return `[${value.map((v) => stableStringify(v)).join(",")}]`;
171 }
172 if (isPlainObject(value)) {
173 const keys = Object.keys(value).sort();
174 return `{${keys.map((k) => `${JSON.stringify(k)}:${stableStringify(value[k])}`).join(",")}}`;
175 }
176 return JSON.stringify(value);
177}
178
179function makeDescriptorKey(scenario, framework, params) {
180 return `${scenario}|${framework}|${stableStringify(params ?? {})}`;

Callers 3

makeDescriptorKeyFunction · 0.70
overrideMatchesFunction · 0.70
sortChecksFunction · 0.70

Calls 2

isPlainObjectFunction · 0.70
keysMethod · 0.65

Tested by

no test coverage detected