MCPcopy
hub / github.com/coder/mux / normalizeOptionalModelStringArray

Function normalizeOptionalModelStringArray

src/node/config.ts:378–395  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

376}
377
378function normalizeOptionalModelStringArray(value: unknown): string[] | undefined {
379 if (!Array.isArray(value)) {
380 return undefined;
381 }
382
383 const out: string[] = [];
384 const seen = new Set<string>();
385
386 for (const item of value) {
387 const normalized = normalizeOptionalModelString(item);
388 if (!normalized) continue;
389 if (seen.has(normalized)) continue;
390 seen.add(normalized);
391 out.push(normalized);
392 }
393
394 return out;
395}
396
397function normalizeAiDefaultsModelStrings<T extends Record<string, { modelString?: string }>>(
398 value: T

Callers 2

loadConfigOrDefaultMethod · 0.85
saveConfigMethod · 0.85

Calls 4

addMethod · 0.80
pushMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected