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

Function stripVirtualPropsDeep

packages/db/tests/query/includes.test.ts:96–115  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

94}
95
96function stripVirtualPropsDeep(value: any): any {
97 if (Array.isArray(value)) {
98 return value.map((item) => stripVirtualPropsDeep(item))
99 }
100
101 if (value && typeof value === `object`) {
102 if (`toArray` in value) {
103 return toTree(value)
104 }
105
106 const base = stripVirtualProps(value)
107 const out: Record<string, any> = {}
108 for (const [key, entry] of Object.entries(base || {})) {
109 out[key] = stripVirtualPropsDeep(entry)
110 }
111 return out
112 }
113
114 return value
115}
116
117function plainRows(collectionOrArray: any): Array<any> {
118 const rows = Array.isArray(collectionOrArray)

Callers 3

plainRowsFunction · 0.70
toTreeFunction · 0.70
includes.test.tsFile · 0.70

Calls 4

toTreeFunction · 0.85
stripVirtualPropsFunction · 0.50
mapMethod · 0.45
entriesMethod · 0.45

Tested by

no test coverage detected