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

Function isExpressionLike

packages/db/src/query/ir.ts:218–255  ·  view source on GitHub ↗
(value: any)

Source from the content-addressed store, hash-verified

216 * Prefer this over ad-hoc local implementations to keep behavior consistent.
217 */
218export function isExpressionLike(value: any): boolean {
219 if (
220 value instanceof Aggregate ||
221 value instanceof ConditionalSelect ||
222 value instanceof Func ||
223 value instanceof PropRef ||
224 value instanceof Value ||
225 value instanceof IncludesSubquery
226 ) {
227 return true
228 }
229
230 if (!value || typeof value !== `object`) {
231 return false
232 }
233
234 if (value.type === `conditionalSelect`) {
235 return Array.isArray(value.branches)
236 }
237
238 if (value.type === `agg` || value.type === `func`) {
239 return typeof value.name === `string` && Array.isArray(value.args)
240 }
241
242 if (value.type === `ref`) {
243 return Array.isArray(value.path)
244 }
245
246 if (value.type === `val`) {
247 return `value` in value
248 }
249
250 if (value.type === `includesSubquery`) {
251 return `query` in value && `fieldName` in value
252 }
253
254 return false
255}
256
257/**
258 * Helper functions for working with Where clauses

Callers 12

isNestedSelectObjectFunction · 0.85
compileSelectValueFunction · 0.85
isNestedSelectObjectFunction · 0.85
addFromObjectFunction · 0.85
containsAggregateFunction · 0.85
isNestedSelectObjectFunction · 0.85
isNestedSelectObjectFunction · 0.85
whereMethod · 0.85
havingMethod · 0.85
isPlainObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…