fix(scanner): handle legacy Book Dock series indexes

Normalize numeric JSON snapshots at the Book Dock boundary and reject malformed runtime values without aborting filing.

Closes #1241
This commit is contained in:
neon
2026-09-02 00:58:39 +00:00
parent 43a7c671d9
commit adab5c8783
6 changed files with 79 additions and 5 deletions
+3 -2
View File
@@ -48,8 +48,9 @@ export function compareSeriesIndices(a: SeriesIndex, b: SeriesIndex): number {
}
export function formatSeriesIndex(value: SeriesIndex | null): string | null {
if (value == null) return null;
const [whole, fraction] = value.split(".");
const parsed = parseSeriesIndex(value);
if (parsed == null) return null;
const [whole, fraction] = parsed.split(".");
const padded = whole.padStart(2, "0");
return fraction === undefined ? padded : `${padded}.${fraction}`;
}