(
tableId: Id,
table: Table,
forceDel?: boolean,
)
| 658 | ) as TablesMap; |
| 659 | |
| 660 | const setValidTable = ( |
| 661 | tableId: Id, |
| 662 | table: Table, |
| 663 | forceDel?: boolean, |
| 664 | ): TableMap => |
| 665 | ifTransformed( |
| 666 | table, |
| 667 | () => |
| 668 | forceDel |
| 669 | ? table |
| 670 | : ifNotUndefined( |
| 671 | middleware[2], |
| 672 | (willSetTable) => |
| 673 | whileMutating(() => |
| 674 | willSetTable(tableId, structuredClone(table)), |
| 675 | ), |
| 676 | () => table, |
| 677 | ), |
| 678 | (validTable) => |
| 679 | mapMatch( |
| 680 | mapEnsure(tablesMap, tableId, () => { |
| 681 | tableIdsChanged(tableId, 1); |
| 682 | mapSet(tablePoolFunctions, tableId, getPoolFunctions()); |
| 683 | mapSet(tableCellIds, tableId, mapNew()); |
| 684 | return mapNew(); |
| 685 | }), |
| 686 | validTable, |
| 687 | (tableMap, rowId, row) => setValidRow(tableId, tableMap, rowId, row), |
| 688 | (tableMap, rowId) => delValidRow(tableId, tableMap, rowId), |
| 689 | ), |
| 690 | objIsEqual, |
| 691 | ) as TableMap; |
| 692 | |
| 693 | const setValidRow = ( |
| 694 | tableId: Id, |
no test coverage detected
searching dependent graphs…