MCPcopy
hub / github.com/tinyplex/tinybase / applyRowDirectly

Function applyRowDirectly

src/store/index.ts:728–757  ·  view source on GitHub ↗
(
    tableId: Id,
    tableMap: TableMap,
    rowId: Id,
    row: Row,
    skipMiddleware?: boolean,
  )

Source from the content-addressed store, hash-verified

726 ) as RowMap;
727
728 const applyRowDirectly = (
729 tableId: Id,
730 tableMap: TableMap,
731 rowId: Id,
732 row: Row,
733 skipMiddleware?: boolean,
734 ): void => {
735 mapMatch(
736 mapEnsure(tableMap, rowId, () => {
737 rowIdsChanged(tableId, rowId, 1);
738 return mapNew();
739 }),
740 row,
741 (rowMap, cellId, cell) =>
742 ifNotUndefined(
743 getValidatedCell(tableId, rowId, cellId, cell as Cell),
744 (validCell) =>
745 setValidCell(
746 tableId,
747 rowId,
748 rowMap,
749 cellId,
750 validCell,
751 skipMiddleware,
752 ),
753 ),
754 (rowMap, cellId) =>
755 delValidCell(tableId, tableMap, rowId, rowMap, cellId, true),
756 );
757 };
758
759 const setValidCell = (
760 tableId: Id,

Callers 1

setCellFunction · 0.70

Calls 7

mapMatchFunction · 0.90
mapEnsureFunction · 0.90
mapNewFunction · 0.90
rowIdsChangedFunction · 0.70
getValidatedCellFunction · 0.70
setValidCellFunction · 0.70
delValidCellFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…