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

Function stripVirtualPropsAndSymbols

packages/db/tests/query/case-when.test.ts:59–73  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

57}
58
59function stripVirtualPropsAndSymbols(value: any): any {
60 if (Array.isArray(value)) {
61 return value.map((entry) => stripVirtualPropsAndSymbols(entry))
62 }
63
64 if (value && typeof value === `object`) {
65 const out: Record<string, any> = {}
66 for (const [key, entry] of Object.entries(stripVirtualProps(value))) {
67 out[key] = stripVirtualPropsAndSymbols(entry)
68 }
69 return out
70 }
71
72 return value
73}
74
75function childRows(collection: any): Array<any> {
76 return [...collection.toArray].map((row) => stripVirtualPropsAndSymbols(row))

Callers 2

childRowsFunction · 0.85
case-when.test.tsFile · 0.85

Calls 3

stripVirtualPropsFunction · 0.50
mapMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected