Is there a way in JavaScript to check if a string is a URL?
RegExes are excluded because the URL is most likely written like stackoverflow; that is to s
stackoverflow
Rely on a library: https://www.npmjs.com/package/valid-url
import { isWebUri } from 'valid-url'; // ... if (!isWebUri(url)) { return "Not a valid url."; }