Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

extractFieldPath.md

36 lines679 Bytes

Function: extractFieldPath()

function extractFieldPath(expr): FieldPath | null;

Defined in: packages/db/src/query/expression-helpers.ts:107

Extracts the field path from a PropRef expression. Returns null for non-ref expressions.

Parameters

expr

BasicExpression

The expression to extract from

Returns

FieldPath | null

The field path array, or null

Example

const field = extractFieldPath(someExpression)
// Returns: ['product', 'category']