/** * Where a looked-up row's details came from (books.ts, films.ts): `filled_from` is a JSON object of column to * source, each new fill said over the ones the row held. */ /** The row's `filled_from` with `more` said over it. */ export function filledFrom(held: unknown, more: Record): string { let was: Record = {}; if (typeof held === "string" && held.trim()) { try { const parsed = JSON.parse(held) as unknown; if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) was = parsed as Record; } catch { was = {}; } } return JSON.stringify({ ...was, ...more }); }