(link: string)
| 23 | `${process.env.NEXT_PUBLIC_WEBAPP_URL}tags/${encodeURIComponent(tag)}`; |
| 24 | |
| 25 | export function isValidHttpUrl(link: string): boolean { |
| 26 | try { |
| 27 | const url = new URL(link); |
| 28 | |
| 29 | return url.protocol === 'http:' || url.protocol === 'https:'; |
| 30 | } catch (_) { |
| 31 | return false; |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | const validSchema = ['http:', 'https:']; |
| 36 | export const withHttps = (url: string): string => |
no outgoing calls
no test coverage detected