(url)
| 22 | * Test whether a given URL is retrievable. |
| 23 | */ |
| 24 | export async function urlExists(url) { |
| 25 | ui.status('Testing url ' + url); |
| 26 | try { |
| 27 | const response = await fetch(url, {method: 'HEAD'}); |
| 28 | return response.ok; |
| 29 | } catch (err) { |
| 30 | return false; |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Load pretrained model stored at a remote URL. |
nothing calls this directly
no outgoing calls
no test coverage detected