(
tableId: Id,
table: TableMap,
rowId: Id,
row: RowMap,
cellId: Id,
forceDel?: boolean,
skipMiddleware?: boolean,
)
| 902 | }; |
| 903 | |
| 904 | const delValidCell = ( |
| 905 | tableId: Id, |
| 906 | table: TableMap, |
| 907 | rowId: Id, |
| 908 | row: RowMap, |
| 909 | cellId: Id, |
| 910 | forceDel?: boolean, |
| 911 | skipMiddleware?: boolean, |
| 912 | ): void => { |
| 913 | const defaultCell = mapGet( |
| 914 | mapGet(tablesSchemaRowCache, tableId)?.[0], |
| 915 | cellId, |
| 916 | ); |
| 917 | if (!isUndefined(defaultCell) && !forceDel) { |
| 918 | return setValidCell(tableId, rowId, row, cellId, defaultCell); |
| 919 | } |
| 920 | if ( |
| 921 | skipMiddleware || |
| 922 | (whileMutating(() => middleware[10]?.(tableId, rowId, cellId)) ?? true) |
| 923 | ) { |
| 924 | const delCell = (cellId: Id) => { |
| 925 | cellChanged(tableId, rowId, cellId, mapGet(row, cellId)); |
| 926 | cellIdsChanged(tableId, rowId, cellId, -1); |
| 927 | mapSet(row, cellId); |
| 928 | }; |
| 929 | if (isUndefined(defaultCell)) { |
| 930 | delCell(cellId); |
| 931 | } else { |
| 932 | mapForEach(row, delCell); |
| 933 | } |
| 934 | if (collIsEmpty(row)) { |
| 935 | rowIdsChanged(tableId, rowId, -1); |
| 936 | if (collIsEmpty(mapSet(table, rowId))) { |
| 937 | tableIdsChanged(tableId, -1); |
| 938 | mapSet(tablesMap, tableId); |
| 939 | mapSet(tablePoolFunctions, tableId); |
| 940 | mapSet(tableCellIds, tableId); |
| 941 | } |
| 942 | } |
| 943 | } |
| 944 | }; |
| 945 | |
| 946 | const delValidValue = (valueId: Id, skipMiddleware?: boolean): void => { |
| 947 | const defaultValue = mapGet(valuesDefaulted, valueId); |
no test coverage detected
searching dependent graphs…