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

Function mergeTablesStamps

src/synchronizers/index.ts:127–153  ·  view source on GitHub ↗
(
    tablesStamp: TablesStamp,
    [tableStamps2, tablesTime2]: TablesStamp,
  )

Source from the content-addressed store, hash-verified

125 });
126
127 const mergeTablesStamps = (
128 tablesStamp: TablesStamp,
129 [tableStamps2, tablesTime2]: TablesStamp,
130 ) => {
131 objForEach(tableStamps2, ([rowStamps2, tableTime2], tableId) => {
132 const tableStamp = objEnsure(
133 tablesStamp[0],
134 tableId,
135 stampNewObj<RowStamp>,
136 );
137 objForEach(rowStamps2, ([cellStamps2, rowTime2], rowId) => {
138 const rowStamp = objEnsure(
139 tableStamp[0],
140 rowId,
141 stampNewObj<CellStamp>,
142 );
143 objForEach(
144 cellStamps2,
145 ([cell2, cellTime2], cellId) =>
146 (rowStamp[0][cellId] = stampNew(cell2, cellTime2)),
147 );
148 rowStamp[1] = getLatestHlc(rowStamp[1], rowTime2);
149 });
150 tableStamp[1] = getLatestHlc(tableStamp[1], tableTime2);
151 });
152 tablesStamp[1] = getLatestHlc(tablesStamp[1], tablesTime2);
153 };
154
155 const getChangesFromOtherStore = (
156 otherClientId: IdOrNull = null,

Callers 1

getChangesFromOtherStoreFunction · 0.70

Calls 4

objForEachFunction · 0.90
objEnsureFunction · 0.90
stampNewFunction · 0.90
getLatestHlcFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…