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

Function createStandardFormatResult

actions/setup/js/update_handler_factory.cjs:92–104  ·  view source on GitHub ↗

* Creates a standard format success result function * This factory eliminates duplication across all update handlers * * @param {Object} fieldMapping - Mapping of result fields * @param {string} fieldMapping.numberField - Field name for number (e.g., "number", "pull_request_number") * @param {s

(fieldMapping)

Source from the content-addressed store, hash-verified

90 * @returns {Function} Format success result function
91 */
92function createStandardFormatResult(fieldMapping) {
93 const { numberField, urlField, urlSource } = fieldMapping;
94
95 return function formatSuccessResult(itemNumber, updatedItem) {
96 const result = {
97 success: true,
98 [numberField]: itemNumber,
99 [urlField]: updatedItem[urlSource],
100 title: updatedItem.title,
101 };
102 return result;
103 };
104}
105
106/**
107 * Creates a handler factory function with common update logic

Callers 3

update_issue.cjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected