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

Function projectRef

javascript/selenium-webdriver/project_bidi_schema.mjs:174–189  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

172}
173
174function projectRef(type) {
175 const all = typeList(type)
176 // A missing type (undefined/empty input, e.g. a malformed array element or map
177 // value) is not a `null` value — fail closed so checkSchema's unknown guard
178 // catches it instead of silently producing a valid-looking `null`.
179 if (all.length === 0) return { primitive: 'unknown' }
180 const entries = all.filter((e) => !isNullAlt(e))
181 const node =
182 entries.length > 1
183 ? entries.every(isLiteral)
184 ? enumNode(entries)
185 : unionNode(entries.map(projectEntry))
186 : projectEntry(entries[0])
187 if (entries.length < all.length) node.nullable = true // a `null` alternative means the value may be null
188 return node
189}
190
191const BOUND_OPERATORS = {
192 ge: { side: 'min', exclusive: false },

Callers 4

projectEntryFunction · 0.85
projectFieldFunction · 0.85
projectTypeFunction · 0.85
projectRecordFunction · 0.85

Calls 7

isNullAltFunction · 0.85
enumNodeFunction · 0.85
unionNodeFunction · 0.85
projectEntryFunction · 0.85
filterMethod · 0.80
typeListFunction · 0.70
mapMethod · 0.45

Tested by

no test coverage detected