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

Function toPropRef

packages/db/src/query/compiler/lazy-targets.ts:199–213  ·  view source on GitHub ↗
(expr: unknown)

Source from the content-addressed store, hash-verified

197}
198
199function toPropRef(expr: unknown): PropRef | undefined {
200 if (expr instanceof PropRef) {
201 return expr
202 }
203 if (
204 expr &&
205 typeof expr === `object` &&
206 `type` in expr &&
207 (expr as { type?: string }).type === `ref` &&
208 Array.isArray((expr as { path?: unknown }).path)
209 ) {
210 return new PropRef((expr as unknown as { path: Array<string> }).path)
211 }
212 return undefined
213}

Callers 2

getLazyLoadTargetsFunction · 0.85
getTargetsFromQueryRefFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected