MCPcopy Create free account
hub / github.com/TanStack/db / cloneSnapshotValue

Function cloneSnapshotValue

packages/db/src/query/live/collection-config-builder.ts:1382–1388  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

1380}
1381
1382function cloneSnapshotValue<T>(value: T): T {
1383 if (value == null || typeof value !== `object`) {
1384 return value
1385 }
1386
1387 return (Array.isArray(value) ? [...value] : { ...value }) as T
1388}
1389
1390/**
1391 * Folds a drained delta into a nested setup's cumulative snapshot, tracking the

Callers 2

accumulateSnapshotFunction · 0.85
seedParentFromSnapshotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected