(urls?: string[])
| 85 | } |
| 86 | |
| 87 | export const testUrls = async (urls?: string[]) => { |
| 88 | if (!urls?.length) { |
| 89 | return null; |
| 90 | } |
| 91 | |
| 92 | try { |
| 93 | const ret = await promiseAny(urls.map(ping)); |
| 94 | if (ret) { |
| 95 | log('ping success, use url:', ret); |
| 96 | return ret; |
| 97 | } |
| 98 | } catch {} |
| 99 | log('all ping failed, use first url:', urls[0]); |
| 100 | return urls[0]; |
| 101 | }; |
| 102 | |
| 103 | export const assertWeb = () => { |
| 104 | if (isWeb) { |
no test coverage detected