(link: string)
| 44 | }): string => `${webappUrl}posts/${post.slug || post.id}`; |
| 45 | |
| 46 | export function isValidHttpUrl(link: string): boolean { |
| 47 | try { |
| 48 | const url = new URL(link); |
| 49 | |
| 50 | return url.protocol === 'http:' || url.protocol === 'https:'; |
| 51 | } catch (_) { |
| 52 | return false; |
| 53 | } |
| 54 | } |
| 55 | |
| 56 | const validSchema = ['http:', 'https:']; |
| 57 | export const withHttps = (url: string): string => |
no outgoing calls
no test coverage detected