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

Function defineEnum

javascript/selenium-webdriver/bidi/serialization/enum.js:31–36  ·  view source on GitHub ↗

* Registers a schema `enum` — a closed set of string, number, or boolean values a * field may hold (e.g. emulation.MediaFeaturesGrid, CSS's `grid` media feature, is * spec'd as the integer 0 or 1, not a string; the schema projector's literalPrimitive() * recognizes a boolean-literal choice the sa

(name, values)

Source from the content-addressed store, hash-verified

29 * membership; also returned so a generator can build a discoverable constant from it.
30 */
31function defineEnum(name, values) {
32 const allowed = new Set(values)
33 const entry = { kind: 'enum', values, includes: (value) => allowed.has(value) }
34 register(name, entry)
35 return entry
36}
37
38module.exports = { defineEnum }

Callers 2

record_test.jsFile · 0.85

Calls 2

registerFunction · 0.70
hasMethod · 0.45

Tested by

no test coverage detected