MCPcopy Create free account
hub / github.com/effect-app/libs / emptyValueFor

Function emptyValueFor

packages/infra/src/Store/Memory.ts:40–63  ·  view source on GitHub ↗
(tag: ComputedProjectionIrExpression["_tag"])

Source from the content-addressed store, hash-verified

38}
39
40const emptyValueFor = (tag: ComputedProjectionIrExpression["_tag"]) => {
41 switch (tag) {
42 case "relation-count":
43 case "relation-distinct-count":
44 case "relation-sum":
45 case "relation-sum-expr":
46 case "relation-sum-expr-normalized":
47 return 0
48 case "relation-sum-expr-by":
49 return [] as unknown[]
50 case "relation-any":
51 return false
52 case "relation-every":
53 return true
54 case "relation-collect":
55 return [] as unknown[]
56 case "relation-collect-fields":
57 return [] as unknown[]
58 case "relation-length":
59 return 0
60 default:
61 return assertUnreachable(tag)
62 }
63}
64
65const computeProjectionValue = (
66 row: FieldValues,

Callers 1

computeProjectionValueFunction · 0.85

Calls 1

assertUnreachableFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…