MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / enumNode

Function enumNode

javascript/selenium-webdriver/project_bidi_schema.mjs:140–146  ·  view source on GitHub ↗
(entries)

Source from the content-addressed store, hash-verified

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.
140function 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.

Callers 1

projectRefFunction · 0.85

Calls 2

literalPrimitiveFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected