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

Function isProviderConfigured

renderer/lib/providerUtils.ts:13–27  ·  view source on GitHub ↗
(provider: Provider | undefined)

Source from the content-addressed store, hash-verified

11 * 实例不存在(如用户 store 中尚无该内置类型的数据)视为未配置。
12 */
13export function isProviderConfigured(provider: Provider | undefined): boolean {
14 if (!provider) return false;
15 const template =
16 PROVIDER_TYPES.find((type) => type.id === provider.type) ??
17 CONFIG_TEMPLATES[provider.type];
18 if (!template) return true;
19 return template.fields
20 .filter((field) => field.required)
21 .every((field) => {
22 const value = provider[field.key];
23 return (
24 value !== undefined && value !== null && String(value).trim() !== ''
25 );
26 });
27}

Callers 9

isConfiguredByIdFunction · 0.90
handleTestTranslationFunction · 0.90
runSampleFunction · 0.90
BatchAiOptimizeDialogFunction · 0.90
SubtitleEditToolbarFunction · 0.90
InlineConfigBarFunction · 0.90
loadFunction · 0.90
pickFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected