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

Function setValidTables

src/store/index.ts:638–658  ·  view source on GitHub ↗
(tables: Tables, forceDel?: boolean)

Source from the content-addressed store, hash-verified

636 );
637
638 const setValidTables = (tables: Tables, forceDel?: boolean): TablesMap =>
639 ifTransformed(
640 tables,
641 () =>
642 forceDel
643 ? tables
644 : ifNotUndefined(
645 middleware[1],
646 (willSetTables) =>
647 whileMutating(() => willSetTables(structuredClone(tables))),
648 () => tables,
649 ),
650 (validTables) =>
651 mapMatch(
652 tablesMap,
653 validTables,
654 (_tables, tableId, table) => setValidTable(tableId, table),
655 (_tables, tableId) => delValidTable(tableId),
656 ),
657 objIsEqual,
658 ) as TablesMap;
659
660 const setValidTable = (
661 tableId: Id,

Callers 2

setTablesFunction · 0.70
delTablesFunction · 0.70

Calls 6

mapMatchFunction · 0.90
ifTransformedFunction · 0.70
whileMutatingFunction · 0.70
setValidTableFunction · 0.70
delValidTableFunction · 0.70
willSetTablesFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…