MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / buildUsageMap

Function buildUsageMap

packages/react/src/lib/oauth-client-usage.ts:25–38  ·  view source on GitHub ↗
(
  connections: readonly Connection[],
)

Source from the content-addressed store, hash-verified

23/** Build an owner+slug → connections map so each app can show what it backs.
24 * Static connections (null `oauthClient`) are skipped. */
25export function buildUsageMap(
26 connections: readonly Connection[],
27): ReadonlyMap<string, readonly Connection[]> {
28 const map = new Map<string, Connection[]>();
29 for (const connection of connections) {
30 const slug = connection.oauthClient;
31 if (slug == null) continue;
32 const key = oauthClientUsageKey(connection.oauthClientOwner, slug);
33 const existing = map.get(key);
34 if (existing) existing.push(connection);
35 else map.set(key, [connection]);
36 }
37 return map;
38}
39
40/** Connections backing one app, or an empty array. */
41export function connectionsUsingClient(

Callers 2

AddAccountModalViewFunction · 0.90

Calls 4

oauthClientUsageKeyFunction · 0.85
pushMethod · 0.80
setMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected