MCPcopy Create free account
hub / github.com/apache/maka / providerObjectArray

Function providerObjectArray

packages/runtime/src/model-fetcher.ts:830–843  ·  view source on GitHub ↗
(
  value: unknown,
  label: string,
  required = false,
)

Source from the content-addressed store, hash-verified

828}
829
830function providerObjectArray<T extends object>(
831 value: unknown,
832 label: string,
833 required = false,
834): T[] {
835 if (value === undefined && !required) return [];
836 if (
837 !Array.isArray(value) ||
838 value.some((item) => item === null || typeof item !== 'object' || Array.isArray(item))
839 ) {
840 throw new ConnectionEffectInvalidResponseError(`Invalid ${label} response`);
841 }
842 return value as T[];
843}
844
845function assertOptionalArray(
846 value: unknown,

Callers 7

fetchCloudflareModelsFunction · 0.85
fetchGitHubCopilotModelsFunction · 0.85
fetchOpenAiCodexModelsFunction · 0.85
fetchCohereModelsFunction · 0.85
fetchPagesFunction · 0.85
toModelInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected