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

Function countOperators

packages/db/tests/cursor.property.test.ts:79–86  ·  view source on GitHub ↗
(expr: unknown, name: string)

Source from the content-addressed store, hash-verified

77
78// Helper to recursively count operators in an expression
79function countOperators(expr: unknown, name: string): number {
80 if (!isFunc(expr)) return 0
81 const selfCount = expr.name === name ? 1 : 0
82 return (
83 selfCount +
84 expr.args.reduce((sum, arg) => sum + countOperators(arg, name), 0)
85 )
86}
87
88describe(`buildCursor property-based tests`, () => {
89 describe(`empty input handling`, () => {

Callers 1

Calls 1

isFuncFunction · 0.85

Tested by

no test coverage detected