(picture?: string)
| 44 | * @returns Whether the url is a picture with a valid protocol. |
| 45 | */ |
| 46 | export const isPictureWithProtocol = (picture?: string): boolean => { |
| 47 | if (!picture) return false; |
| 48 | try { |
| 49 | const url = new URL(picture); |
| 50 | return url.protocol == 'http:' || url.protocol == 'https:'; |
| 51 | } catch { |
| 52 | return false; |
| 53 | } |
| 54 | }; |
| 55 | |
| 56 | const commonImageExtensions = [ |
| 57 | 'apng', |
no outgoing calls
no test coverage detected