History

Use shared object helper in stable source hashing

Rhys Sullivan committed 9 months ago

Commit eade0141 parent a4730c91 file · +1 −1Browse files

Unified · Split

executor/packages/database/src/database/mappers.ts+1−1
@@ -7,7 +7,7 @@ function stableStringify(value: unknown): string { · 6 unmodified lines
7 return `[${value.map((entry) => stableStringify(entry)).join(",")}]`;7 return `[${value.map((entry) => stableStringify(entry)).join(",")}]`;
8 }8 }
9 if (value && typeof value === "object") {9 if (value && typeof value === "object") {
10 const record = value as Record<string, unknown>;10 const record = asRecord(value);
11 const keys = Object.keys(record).sort();11 const keys = Object.keys(record).sort();
12 return `{${keys.map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`).join(",")}}`;12 return `{${keys.map((key) => `${JSON.stringify(key)}:${stableStringify(record[key])}`).join(",")}}`;
13 }13 }