/** * Assign rows to a table source, adding vt_id only when missing (avoids full-row copies). */ export function assignTableRows( rows: Record[] ): Record[] { return rows.map((row, index) => { if (row.vt_id !== undefined && row.vt_id !== null) { return row; } return { ...row, vt_id: row.id ?? index, }; }); }