Verifique-se-i-a-javascript-string-is-a-url

  const isUrl = string => {
      try { return Boolean(new URL(string)); }
      catch(e){ return false; }
  }
Borma