| LCOV - code coverage report | ||||||||||||||||||
|
||||||||||||||||||
Line data Source code 1 : import type { ImportSource } from '@/platform/assets/types/importSource' 2 : 3 : /** 4 : * Check if a URL belongs to a specific import source 5 : */ 6 0 : export function validateSourceUrl(url: string, source: ImportSource): boolean { 7 0 : try { 8 0 : const hostname = new URL(url).hostname.toLowerCase() 9 0 : return source.hostnames.some( 10 : (h) => hostname === h || hostname.endsWith(`.${h}`) 11 : ) 12 : } catch { 13 0 : return false 14 : } 15 : } |
| Generated by: LCOV version 2.0-1 |