(arms)
| 162 | // scalar arm admits (input.Origin's "viewport" / "pointer"), so a binding can reject a wrong |
| 163 | // string too, not just a wrong primitive. Derived once, in the schema, not re-detected per binding. |
| 164 | function unionNode(arms) { |
| 165 | const node = { union: arms } |
| 166 | const primitives = [...new Set(arms.map(scalarArmPrimitive).filter((p) => p !== undefined))] |
| 167 | if (primitives.length === 1) node.scalar = primitives[0] |
| 168 | else if (primitives.length > 1) node.scalar = primitives |
| 169 | const values = arms.filter((a) => a.const !== undefined).map((a) => a.const) |
| 170 | if (values.length) node.scalarValues = values |
| 171 | return node |
| 172 | } |
| 173 | |
| 174 | function projectRef(type) { |
| 175 | const all = typeList(type) |
no test coverage detected