Skip to content

Commit f036ff3

Browse files
committed
refactor(plugin-form): type the child-row advance without any
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014mXUNuFomfj24w7s1pZzhN
1 parent 354bd97 commit f036ff3

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

‎packages/plugin-form/src/MasterDetailForm.tsx‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,11 @@ interface SavedChildRows {
161161
* is still the collection's baseline: a reload that replaced the row state
162162
* while the save was in flight has set a newer one.
163163
*/
164-
diffedAgainst: Record<string, any>[];
164+
diffedAgainst: Record<string, unknown>[];
165165
/** Each row the batch CREATED (the row object it was built from) → the id the server gave it. */
166-
createdIds: Map<Record<string, any>, unknown>;
166+
createdIds: Map<object, unknown>;
167167
/** The baseline after the save: every persisted row, laid over with what this batch wrote to it. */
168-
original: Record<string, any>[];
168+
original: Record<string, unknown>[];
169169
}
170170

171171
/**
@@ -174,8 +174,8 @@ interface SavedChildRows {
174174
* The builder only drops keys from a row (sanitize) and never rewrites one.
175175
*/
176176
function isBuiltFrom(
177-
data: Record<string, any> | undefined,
178-
row: Record<string, any>,
177+
data: Record<string, unknown> | undefined,
178+
row: Record<string, unknown>,
179179
relationshipField: string,
180180
): boolean {
181181
return Object.entries(data ?? {}).every(
@@ -230,8 +230,8 @@ function childRowsAfterSave(
230230
const { childObject, relationshipField } = input;
231231
const rows = input.rows || [];
232232
const original = input.original || [];
233-
const createdIds = new Map<Record<string, any>, unknown>();
234-
const written = new Map<unknown, Record<string, any>>();
233+
const createdIds = new Map<object, unknown>();
234+
const written = new Map<unknown, Record<string, unknown>>();
235235

236236
for (const row of rows) {
237237
if (pairingLost) break;
@@ -254,19 +254,19 @@ function childRowsAfterSave(
254254
}
255255
}
256256

257-
const before = new Map<unknown, Record<string, any>>();
257+
const before = new Map<unknown, Record<string, unknown>>();
258258
for (const r of original) {
259259
const id = idOf(r);
260260
if (id != null) before.set(id, r);
261261
}
262-
const next: Record<string, any>[] = [];
262+
const next: Record<string, unknown>[] = [];
263263
for (const row of rows) {
264264
const id = idOf(row) ?? createdIds.get(row);
265265
if (id == null) continue;
266266
const was = before.get(id);
267267
const wrote = written.get(id);
268268
if (!was && !wrote) continue;
269-
const entry: Record<string, any> = { ...(was ?? {}), ...(wrote ?? {}) };
269+
const entry: Record<string, unknown> = { ...(was ?? {}), ...(wrote ?? {}) };
270270
if (idOf(entry) == null) entry.id = id;
271271
next.push(entry);
272272
}

0 commit comments

Comments
 (0)