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

Function setValidContent

docs/pseudo.esm.sh/tinybase@9.0.0/index.js:1268–1280  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

1266 const setOrDelValues = (values) => objIsEmpty(values) ? delValues() : setValues(values);
1267 const setOrDelValue = (valueId, value, skipMiddleware) => isUndefined(value) ? delValue(valueId, skipMiddleware) : setValue(valueId, value, skipMiddleware);
1268 const setValidContent = (content) => ifTransformed(
1269 content,
1270 () => ifNotUndefined(
1271 middleware[0],
1272 (willSetContent) => whileMutating(() => willSetContent(structuredClone(content))),
1273 () => content
1274 ),
1275 ([tables, values]) => {
1276 (objIsEmpty(tables) ? delTables : setTables)(tables);
1277 (objIsEmpty(values) ? delValues : setValues)(values);
1278 },
1279 contentOrChangesIsEqual
1280 );
1281 const setValidTables = (tables, forceDel) => ifTransformed(
1282 tables,
1283 () => forceDel ? tables : ifNotUndefined(

Callers 1

setContentFunction · 0.70

Calls 4

ifTransformedFunction · 0.70
whileMutatingFunction · 0.70
willSetContentFunction · 0.70
objIsEmptyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…