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

Function setContentOrChanges

src/persisters/common/create.ts:175–191  ·  view source on GitHub ↗
(
    contentOrChanges:
      Content | Changes | MergeableContent | MergeableChanges | undefined,
  )

Source from the content-addressed store, hash-verified

173 };
174
175 const setContentOrChanges = (
176 contentOrChanges:
177 Content | Changes | MergeableContent | MergeableChanges | undefined,
178 ): void => {
179 (isMergeableStore && isArray(contentOrChanges?.[0])
180 ? contentOrChanges?.[2] === 1
181 ? (store as MergeableStore).applyMergeableChanges
182 : (store as MergeableStore).setMergeableContent
183 : contentOrChanges?.[2] === 1
184 ? store.applyChanges
185 : store.setContent)(
186 contentOrChanges as Content &
187 MergeableContent &
188 Changes &
189 MergeableChanges,
190 );
191 };
192
193 const saveAfterMutated = async (): Promise<void> => {
194 if (isAutoSaving() && (store as ProtectedMergeableStore).__?.[0]?.()) {

Callers 2

loadFunction · 0.70
startAutoLoadFunction · 0.70

Calls 1

isArrayFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…