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

Function applyOverrides

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

* Apply Selenium overlay CDDL (see common/bidi/) to the parsed upstream AST: any * production an overlay defines replaces the identically named upstream one, which is * dropped. Kept here rather than in the shared CDDL merge so the overlay is a * schema-generation concern only — the upstream gram

(ast, overrideArgs)

Source from the content-addressed store, hash-verified

175 * any other definition.
176 */
177function applyOverrides(ast, overrideArgs) {
178 if (!overrideArgs.length) return ast
179 const overrides = overrideArgs.flatMap((arg) => parseCddl(arg))
180 const names = new Set(overrides.filter((d) => d?.Name).map((d) => d.Name))
181 return [...ast.filter((d) => !(d?.Name && names.has(d.Name))), ...overrides]
182}
183
184/**
185 * Apply Selenium vendor overlay CDDL (see common/bidi/*-extensions.cddl) to the AST. Each

Callers 1

mainFunction · 0.85

Calls 4

parseCddlFunction · 0.85
filterMethod · 0.80
mapMethod · 0.45
hasMethod · 0.45

Tested by

no test coverage detected