(urlString: string)
| 20 | } |
| 21 | |
| 22 | const isValidUrl = (urlString: string) => { |
| 23 | let url |
| 24 | try { |
| 25 | url = new URL(urlString) |
| 26 | } catch (e) { |
| 27 | return false |
| 28 | } |
| 29 | return url.protocol === 'http:' || url.protocol === 'https:' |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Load the raw model file from either a URL or a local file |