MCPcopy Create free account
hub / github.com/reactnativecn/react-native-update / dedupeEndpoints

Function dedupeEndpoints

src/endpoint.ts:28–43  ·  view source on GitHub ↗
(
  endpoints: Array<string | null | undefined>,
)

Source from the content-addressed store, hash-verified

26};
27
28export const dedupeEndpoints = (
29 endpoints: Array<string | null | undefined>,
30): string[] => {
31 const result: string[] = [];
32 const visited = new Set<string>();
33
34 for (const endpoint of endpoints) {
35 if (!endpoint || visited.has(endpoint)) {
36 continue;
37 }
38 visited.add(endpoint);
39 result.push(endpoint);
40 }
41
42 return result;
43};
44
45export const pickRandomEndpoint = (
46 endpoints: string[],

Callers 4

cloneServerConfigFunction · 0.90
PushyClass · 0.90
endpoint.test.tsFile · 0.90
executeEndpointFallbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected