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

Method merge

javascript/selenium-webdriver/lib/capabilities.js:329–346  ·  view source on GitHub ↗

* Merges another set of capabilities into this instance. * @param {!(Capabilities|Map |Object )} other The other * set of capabilities to merge. * @return {!Capabilities} A self reference.

(other)

Source from the content-addressed store, hash-verified

327 * @return {!Capabilities} A self reference.
328 */
329 merge(other) {
330 if (other) {
331 let otherMap
332 if (other instanceof Capabilities) {
333 otherMap = other.map_
334 } else if (other instanceof Map) {
335 otherMap = other
336 } else {
337 otherMap = toMap(other)
338 }
339 otherMap.forEach((value, key) => {
340 this.set(key, value)
341 })
342 return this
343 } else {
344 throw new TypeError('no capabilities provided for merge')
345 }
346 }
347
348 /**
349 * Deletes an entry from this set of capabilities.

Callers 1

buildMethod · 0.95

Calls 3

setMethod · 0.95
toMapFunction · 0.85
forEachMethod · 0.45

Tested by

no test coverage detected