MCPcopy Create free account
hub / github.com/github/gh-aw / normalizeUpdateProjectOutput

Function normalizeUpdateProjectOutput

actions/setup/js/update_project.cjs:31–48  ·  view source on GitHub ↗

* Normalize agent output keys for update_project. * * Agents sometimes emit camelCase keys even when the schema documents snake_case. * We accept a small set of aliases for backward compatibility and resilience. * * @param {any} value * @returns {any}

(value)

Source from the content-addressed store, hash-verified

29 * @returns {any}
30 */
31function normalizeUpdateProjectOutput(value) {
32 if (!value || typeof value !== "object") return value;
33
34 const output = { ...value };
35
36 if (output.content_type === undefined && output.contentType !== undefined) output.content_type = output.contentType;
37 if (output.content_number === undefined && output.contentNumber !== undefined) output.content_number = output.contentNumber;
38 if (output.target_repo === undefined && output.targetRepo !== undefined) output.target_repo = output.targetRepo;
39
40 if (output.draft_title === undefined && output.draftTitle !== undefined) output.draft_title = output.draftTitle;
41 if (output.draft_body === undefined && output.draftBody !== undefined) output.draft_body = output.draftBody;
42 if (output.draft_issue_id === undefined && output.draftIssueId !== undefined) output.draft_issue_id = output.draftIssueId;
43 if (output.temporary_id === undefined && output.temporaryId !== undefined) output.temporary_id = output.temporaryId;
44
45 if (output.field_definitions === undefined && output.fieldDefinitions !== undefined) output.field_definitions = output.fieldDefinitions;
46
47 return output;
48}
49/**
50 * Parse project number from URL
51 * @param {unknown} projectUrl - Project URL

Callers 3

updateProjectFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected