MCPcopy Index your code
hub / github.com/callstack/agent-device / parseInstallSourceConfig

Function parseInstallSourceConfig

src/utils/install-source-config.ts:24–46  ·  view source on GitHub ↗
(value: unknown, sourceLabel: string)

Source from the content-addressed store, hash-verified

22}
23
24export function parseInstallSourceConfig(value: unknown, sourceLabel: string): DaemonInstallSource {
25 if (!value || typeof value !== 'object' || Array.isArray(value)) {
26 throw new AppError('INVALID_ARGS', `${sourceLabel} installSource must be an object.`);
27 }
28 const record = value as Record<string, unknown>;
29 const type = readRequiredText(record.type, `${sourceLabel} installSource.type`);
30 if (type !== 'github-actions-artifact') {
31 throw new AppError(
32 'INVALID_ARGS',
33 `${sourceLabel} installSource.type must be "github-actions-artifact".`,
34 );
35 }
36 const { owner, repo } = parseRepositorySlug(
37 readRequiredText(record.repo, `${sourceLabel} installSource.repo`),
38 `${sourceLabel} installSource.repo`,
39 );
40 return buildGitHubActionsArtifactInstallSource(
41 owner,
42 repo,
43 record.artifact,
44 `${sourceLabel} installSource.artifact`,
45 );
46}
47
48function buildGitHubActionsArtifactInstallSource(
49 owner: string,

Callers 1

parseConfigObjectFunction · 0.90

Calls 3

parseRepositorySlugFunction · 0.85
readRequiredTextFunction · 0.70

Tested by

no test coverage detected