export function isUrl(str: string): boolean {
  if (!str || typeof str !== 'string') return false;

  try {
    const url = new URL(str);
    return ['http:', 'https:'].includes(url.protocol);
  } catch {
    return false;
  }
}
