export const checkIsValidHttpUrl = (str: string) => { try { const url = new URL(str); return url.protocol === 'http:' || url.protocol === 'https:'; } catch (err) { return false; } };