(url: string, base: string = getBaseUrl())
| 11 | * @returns True if the URL is same-origin, false otherwise (secure default) |
| 12 | */ |
| 13 | export function isSameOrigin(url: string, base: string = getBaseUrl()): boolean { |
| 14 | try { |
| 15 | return new URL(url).origin === new URL(base).origin |
| 16 | } catch { |
| 17 | return false |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | /** |
| 22 | * Validates a name by removing any characters that could cause issues |
no test coverage detected