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

Function setValidContent

src/store/index.ts:621–636  ·  view source on GitHub ↗
(content: Content)

Source from the content-addressed store, hash-verified

619 : setValue(valueId, value, skipMiddleware);
620
621 const setValidContent = (content: Content): void =>
622 ifTransformed(
623 content,
624 () =>
625 ifNotUndefined(
626 middleware[0],
627 (willSetContent) =>
628 whileMutating(() => willSetContent(structuredClone(content))),
629 () => content,
630 ),
631 ([tables, values]) => {
632 (objIsEmpty(tables) ? delTables : setTables)(tables);
633 (objIsEmpty(values) ? delValues : setValues)(values);
634 },
635 contentOrChangesIsEqual,
636 );
637
638 const setValidTables = (tables: Tables, forceDel?: boolean): TablesMap =>
639 ifTransformed(

Callers 1

setContentFunction · 0.70

Calls 4

objIsEmptyFunction · 0.90
ifTransformedFunction · 0.70
whileMutatingFunction · 0.70
willSetContentFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…