export function isValidUrl(string: string) { try { new URL(string); } catch (_) { return false; } return true; }