* 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)
| 90 | * @returns {Function} Format success result function |
| 91 | */ |
| 92 | function 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 |
no outgoing calls
no test coverage detected