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

Function choiceBranches

javascript/selenium-webdriver/normalize_bidi_ast.mjs:279–286  ·  view source on GitHub ↗

* Flatten a choice group's `Properties` into an ordered list of branch property * objects. The parser encodes `a // b` as a mix of array-wrapped and bare * elements; both are choice alternatives here.

(properties)

Source from the content-addressed store, hash-verified

277 * elements; both are choice alternatives here.
278 */
279function choiceBranches(properties) {
280 const branches = []
281 for (const element of properties ?? []) {
282 if (Array.isArray(element)) branches.push(...element.filter((e) => e && typeof e === 'object'))
283 else if (element && typeof element === 'object') branches.push(element)
284 }
285 return branches
286}
287
288/**
289 * Detect a record with an inline variant choice: exactly one anonymous property

Callers 1

detectInlineVariantFunction · 0.85

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected