MCPcopy Index your code
hub / github.com/reactnativecn/react-native-update / testUrls

Function testUrls

src/utils.ts:87–101  ·  view source on GitHub ↗
(urls?: string[])

Source from the content-addressed store, hash-verified

85}
86
87export 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
103export const assertWeb = () => {
104 if (isWeb) {

Callers 1

PushyClass · 0.90

Calls 2

promiseAnyFunction · 0.85
logFunction · 0.85

Tested by

no test coverage detected