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

Function getMergeableTableDiff

src/mergeable-store/index.ts:500–518  ·  view source on GitHub ↗
(
    otherTableHashes: TableHashes,
  )

Source from the content-addressed store, hash-verified

498 mapToObj(contentStampMap[0][0], getStampHash);
499
500 const getMergeableTableDiff = (
501 otherTableHashes: TableHashes,
502 ): [newTables: TablesStamp, differingTableHashes: TableHashes] => {
503 const newTables: TablesStamp = stampNewObj(contentStampMap[0][1]);
504 const differingTableHashes: TableHashes = {};
505 mapForEach(
506 contentStampMap[0][0],
507 (tableId, [tableStampMap, tableHlc, hash]) =>
508 objHas(otherTableHashes, tableId)
509 ? hash != otherTableHashes[tableId]
510 ? (differingTableHashes[tableId] = hash)
511 : 0
512 : (newTables[0][tableId] = stampMapToObjWithoutHash(
513 [tableStampMap, tableHlc],
514 (rowStampMap) => stampMapToObjWithoutHash(rowStampMap),
515 )),
516 );
517 return [newTables, differingTableHashes];
518 };
519
520 const getMergeableRowHashes = (otherTableHashes: TableHashes): RowHashes => {
521 const rowHashes: RowHashes = {};

Callers

nothing calls this directly

Calls 4

stampNewObjFunction · 0.90
mapForEachFunction · 0.90
objHasFunction · 0.90
stampMapToObjWithoutHashFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…