MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / toStringArrayOrUndefined

Function toStringArrayOrUndefined

packages/oauth/src/custom-registry.ts:82–91  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

80}
81
82function toStringArrayOrUndefined(value: unknown): readonly string[] | undefined {
83 if (value === undefined || value === null) return undefined;
84 if (!Array.isArray(value)) return undefined;
85 const out: string[] = [];
86 for (const item of value) {
87 if (typeof item !== 'string') return undefined;
88 out.push(item);
89 }
90 return out;
91}
92
93function toModelEntry(value: unknown): CustomRegistryModelEntry | undefined {
94 if (!isRecord(value)) return undefined;

Callers 2

toModelEntryFunction · 0.85
toProviderEntryFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected