export const isUrl = (val: string) => { let url; try { url = new URL(val); } catch (_) { return false; } return url.protocol === 'http:' || url.protocol === 'https:'; }; export const getImageLink = (url: string) => { const imageUrl = url.includes('@sha') ? url.split('@sha')[0] : url; return imageUrl.startsWith('http') || imageUrl.startsWith('https') ? imageUrl : `https://${imageUrl}`; };