MCPcopy Index your code
hub / github.com/tinyplex/tinybase / delValidCell

Function delValidCell

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1450–1479  ·  view source on GitHub ↗
(tableId, table, rowId, row, cellId, forceDel, skipMiddleware)

Source from the content-addressed store, hash-verified

1448 }
1449 };
1450 const delValidCell = (tableId, table, rowId, row, cellId, forceDel, skipMiddleware) => {
1451 const defaultCell = mapGet(
1452 mapGet(tablesSchemaRowCache, tableId)?.[0],
1453 cellId
1454 );
1455 if (!isUndefined(defaultCell) && !forceDel) {
1456 return setValidCell(tableId, rowId, row, cellId, defaultCell);
1457 }
1458 if (skipMiddleware || (whileMutating(() => middleware[10]?.(tableId, rowId, cellId)) ?? true)) {
1459 const delCell2 = (cellId2) => {
1460 cellChanged(tableId, rowId, cellId2, mapGet(row, cellId2));
1461 cellIdsChanged(tableId, rowId, cellId2, -1);
1462 mapSet(row, cellId2);
1463 };
1464 if (isUndefined(defaultCell)) {
1465 delCell2(cellId);
1466 } else {
1467 mapForEach(row, delCell2);
1468 }
1469 if (collIsEmpty(row)) {
1470 rowIdsChanged(tableId, rowId, -1);
1471 if (collIsEmpty(mapSet(table, rowId))) {
1472 tableIdsChanged(tableId, -1);
1473 mapSet(tablesMap, tableId);
1474 mapSet(tablePoolFunctions, tableId);
1475 mapSet(tableCellIds, tableId);
1476 }
1477 }
1478 }
1479 };
1480 const delValidValue = (valueId, skipMiddleware) => {
1481 const defaultValue = mapGet(valuesDefaulted, valueId);
1482 if (!isUndefined(defaultValue)) {

Callers 3

setValidRowFunction · 0.70
applyRowDirectlyFunction · 0.70
delCellFunction · 0.70

Calls 10

mapGetFunction · 0.70
isUndefinedFunction · 0.70
setValidCellFunction · 0.70
whileMutatingFunction · 0.70
delCell2Function · 0.70
mapForEachFunction · 0.70
collIsEmptyFunction · 0.70
rowIdsChangedFunction · 0.70
mapSetFunction · 0.70
tableIdsChangedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…