MCPcopy Index your code
hub / github.com/TanStack/db / stripVirtualProps

Function stripVirtualProps

packages/db/tests/utils.ts:17–29  ·  view source on GitHub ↗
(
  value: T,
)

Source from the content-addressed store, hash-verified

15> = WithVirtualProps<T, TKey>
16
17export const stripVirtualProps = <T extends Record<string, any> | undefined>(
18 value: T,
19) => {
20 if (!value || typeof value !== `object`) return value
21 const {
22 $synced: _synced,
23 $origin: _origin,
24 $key: _key,
25 $collectionId: _collectionId,
26 ...rest
27 } = value as Record<string, unknown>
28 return rest as T
29}
30
31export const omitVirtualProps = <T extends Record<string, any>>(
32 value: T,

Callers 15

query.test.tsFile · 0.90
rxdb.test.tsFile · 0.90
normalizeChangeFunction · 0.90
local-only.test.tsFile · 0.90
stripValuesFunction · 0.90
stripEntriesFunction · 0.90
getStateValueFunction · 0.90
stripChangeFunction · 0.90
getStateValueFunction · 0.90

Calls

no outgoing calls

Tested by 15

normalizeChangeFunction · 0.72
stripValuesFunction · 0.72
stripEntriesFunction · 0.72
getStateValueFunction · 0.72
stripChangeFunction · 0.72
getStateValueFunction · 0.72
getStateEntriesFunction · 0.72
normalizeChangeFunction · 0.72
stripCollectionStateFunction · 0.72
stripStateFunction · 0.72
createBasicTestsFunction · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…