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

Function getMergeableCellDiff

src/mergeable-store/index.ts:586–615  ·  view source on GitHub ↗
(
    otherTableRowCellHashes: CellHashes,
  )

Source from the content-addressed store, hash-verified

584 };
585
586 const getMergeableCellDiff = (
587 otherTableRowCellHashes: CellHashes,
588 ): TablesStamp => {
589 const [[tableStampMaps, tablesHlc]] = contentStampMap;
590 const tablesObj: TablesStamp[0] = {};
591 objForEach(otherTableRowCellHashes, (otherRowCellHashes, tableId) =>
592 objForEach(otherRowCellHashes, (otherCellHashes, rowId) =>
593 ifNotUndefined(
594 mapGet(tableStampMaps, tableId),
595 ([rowStampMaps, tableHlc]) =>
596 ifNotUndefined(
597 mapGet(rowStampMaps, rowId),
598 ([cellStampMaps, rowHlc]) =>
599 mapForEach(cellStampMaps, (cellId, [cell, cellHlc, hash]) =>
600 hash !== otherCellHashes[cellId]
601 ? (objEnsure(
602 objEnsure(tablesObj, tableId, () =>
603 stampNewObj(tableHlc),
604 )[0],
605 rowId,
606 () => stampNewObj(rowHlc),
607 )[0][cellId] = [cell, cellHlc])
608 : 0,
609 ),
610 ),
611 ),
612 ),
613 );
614 return stampNew(tablesObj, tablesHlc);
615 };
616
617 const getMergeableValueHashes = (): ValueHashes =>
618 mapToObj(contentStampMap[1][0], getStampHash);

Callers

nothing calls this directly

Calls 6

objForEachFunction · 0.90
mapGetFunction · 0.90
mapForEachFunction · 0.90
objEnsureFunction · 0.90
stampNewObjFunction · 0.90
stampNewFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…