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

Function walkExpression

packages/db/src/query/expression-helpers.ts:150–161  ·  view source on GitHub ↗
(
  expr: BasicExpression | undefined | null,
  visitor: (node: BasicExpression) => void,
)

Source from the content-addressed store, hash-verified

148 * ```
149 */
150export function walkExpression(
151 expr: BasicExpression | undefined | null,
152 visitor: (node: BasicExpression) => void,
153): void {
154 if (!expr) return
155
156 visitor(expr)
157
158 if (expr.type === `func`) {
159 expr.args.forEach((arg: BasicExpression) => walkExpression(arg, visitor))
160 }
161}
162
163/**
164 * Parses a WHERE expression into a custom format using provided handlers.

Callers 1

Calls 1

forEachMethod · 0.45

Tested by

no test coverage detected