(entries)
| 138 | // not hoist to a named enum. Carry the literals' shared primitive so the scalar is |
| 139 | // typed rather than opaque — a binding can then reject a wrong-primitive wire value. |
| 140 | function enumNode(entries) { |
| 141 | const values = entries.map((e) => e.Value) |
| 142 | const node = { enum: values } |
| 143 | const primitive = literalPrimitive(values) |
| 144 | if (primitive) node.primitive = primitive |
| 145 | return node |
| 146 | } |
| 147 | |
| 148 | // The primitive a bare-scalar union arm accepts: a `{ primitive }` arm directly, or the |
| 149 | // value type of a `{ const }` arm. Undefined for an object / list / ref arm. |
no test coverage detected