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

Method port

javascript/selenium-webdriver/bidi/urlPattern.js:54–61  ·  view source on GitHub ↗

* Sets the port for the URL pattern. * * @param {number} port - The port number to set. * @returns {UrlPattern} - Returns the updated instance of the URL pattern for chaining. * @throws {Error} - Throws an error if the port is not a number.

(port)

Source from the content-addressed store, hash-verified

52 * @throws {Error} - Throws an error if the port is not a number.
53 */
54 port(port) {
55 if (typeof port === 'number') {
56 this.#map.set('port', port.toString())
57 } else {
58 throw new Error(`Port must be a number. Received:'${port}'`)
59 }
60 return this
61 }
62
63 /**
64 * Sets the pathname for the URL pattern.

Calls 2

setMethod · 0.65
toStringMethod · 0.65

Tested by

no test coverage detected