(scope: string)
| 77 | * @returns true if the scope is considered localhost, false otherwise |
| 78 | */ |
| 79 | export function isLocalhost(scope: string): boolean { |
| 80 | // Use non-capturing groups and ensure localhost is at word boundary |
| 81 | // This prevents matching domains like "mylocalhost.com" while allowing valid localhost URLs |
| 82 | return /(?:^https?:\/\/)?(?:(?:^|[^\w.])localhost|\[::1\]|127(?:\.\d{1,3}){3})(?::\d+)?(?:\/.*)?$/.test( |
| 83 | scope, |
| 84 | ); |
| 85 | } |
| 86 | |
| 87 | export enum DriverReadyState { |
| 88 | // The SW is operating in a normal mode, responding to all traffic. |
no test coverage detected
searching dependent graphs…