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

Function applyVendor

javascript/selenium-webdriver/generate_bidi.mjs:194–202  ·  view source on GitHub ↗

* Apply Selenium vendor overlay CDDL (see common/bidi/*-extensions.cddl) to the AST. Each * `--vendor-cddl` is ` = `, the namespace being the wire prefix the vendor owns * (`moz` for `moz:` fields). A vendor overlay extends a spec type through a ` Extension` * group of typed b

(ast, vendorArgs)

Source from the content-addressed store, hash-verified

192 * out of the shared, browser-neutral schema into a separate `vendor` section.
193 */
194function applyVendor(ast, vendorArgs) {
195 if (!vendorArgs.length) return ast
196 const specGroups = new Set(ast.filter((d) => d?.Type === 'group').map((d) => d.Name))
197 const vendorDefs = vendorArgs.flatMap((arg) => {
198 const [namespace, file] = splitVendorArg(arg)
199 return tagVendorDefs(parseCddl(file), namespace, specGroups)
200 })
201 return [...ast, ...vendorDefs]
202}
203
204function splitVendorArg(arg) {
205 const i = arg.indexOf('=')

Callers 1

mainFunction · 0.85

Calls 5

splitVendorArgFunction · 0.85
tagVendorDefsFunction · 0.85
parseCddlFunction · 0.85
filterMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected