* @param {string} URL url * @returns {boolean} true when URL is absolute, otherwise false
(URL)
| 412 | * @returns {boolean} true when URL is absolute, otherwise false |
| 413 | */ |
| 414 | static isAbsoluteURL(URL) { |
| 415 | // Don't match Windows paths `c:\` |
| 416 | if (/^[a-zA-Z]:\\/.test(URL)) { |
| 417 | return false; |
| 418 | } |
| 419 | |
| 420 | // Scheme: https://tools.ietf.org/html/rfc3986#section-3.1 |
| 421 | // Absolute URL: https://tools.ietf.org/html/rfc3986#section-4.3 |
| 422 | return /^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(URL); |
| 423 | } |
| 424 | |
| 425 | /** |
| 426 | * @param {string} gatewayOrFamily gateway or family |
no outgoing calls
no test coverage detected