Dołącz HTTP do URL

const withHttp = url => !/^https?:\/\//i.test(url) ? `http://${url}` : url;
Distinct Duck