fix: preserve best-general rank data parity

This commit is contained in:
2026-07-26 06:03:21 +00:00
parent 06179cbd4f
commit 875dc610fb
17 changed files with 460 additions and 197 deletions
@@ -14,6 +14,12 @@ export interface SnapshotComparisonOptions {
type FlatSnapshot = Map<string, unknown>;
const entityKey = (value: Record<string, unknown>, index: number): string => {
if (
(typeof value.generalId === 'number' || typeof value.generalId === 'string') &&
typeof value.type === 'string'
) {
return `${String(value.generalId)}:${value.type}`;
}
for (const key of ['id', 'generalId', 'nationId', 'fromNationId']) {
const candidate = value[key];
if (typeof candidate === 'number' || typeof candidate === 'string') {