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

Function isExpressionValue

packages/db/src/query/builder/functions.ts:779–812  ·  view source on GitHub ↗
(value: CaseWhenValue | undefined)

Source from the content-addressed store, hash-verified

777}
778
779function isExpressionValue(value: CaseWhenValue | undefined): boolean {
780 if (isRefProxy(value)) return true
781 if (value instanceof Aggregate || value instanceof Func) return true
782 if (value == null) return true
783 if (
784 typeof value === `string` ||
785 typeof value === `number` ||
786 typeof value === `boolean` ||
787 typeof value === `bigint`
788 ) {
789 return true
790 }
791 if (value instanceof Date || Array.isArray(value)) return true
792 if (typeof value === `object`) {
793 const candidate = value as {
794 type?: unknown
795 args?: unknown
796 name?: unknown
797 path?: unknown
798 value?: unknown
799 }
800
801 if (
802 (candidate.type === `agg` || candidate.type === `func`) &&
803 typeof candidate.name === `string` &&
804 Array.isArray(candidate.args)
805 ) {
806 return true
807 }
808 if (candidate.type === `ref` && Array.isArray(candidate.path)) return true
809 if (candidate.type === `val` && `value` in candidate) return true
810 }
811 return false
812}
813
814function isConditionValue(value: CaseWhenValue | undefined): boolean {
815 return isExpressionValue(value) && !Array.isArray(value)

Callers 2

isConditionValueFunction · 0.85

Calls 1

isRefProxyFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…