MCPcopy
hub / github.com/buxuku/SmartSub / pick

Function pick

renderer/lib/providerPanelUtils.ts:88–92  ·  view source on GitHub ↗
(id: string | null | undefined)

Source from the content-addressed store, hash-verified

86 preferredId?: string | null,
87): string {
88 const pick = (id: string | null | undefined) => {
89 if (!id) return null;
90 const p = providers.find((x) => x.id === id);
91 return p && isProviderConfigured(p) ? id : null;
92 };
93 return (
94 pick(preferredId) ??
95 pick(readStoredProviderId()) ??

Callers 1

Calls 1

isProviderConfiguredFunction · 0.90

Tested by

no test coverage detected