(labelSpecs, labelIdByName)
| 129 | } |
| 130 | |
| 131 | function buildIssueIntentLabelUpdates(labelSpecs, labelIdByName) { |
| 132 | return labelSpecs.map(spec => { |
| 133 | const labelId = labelIdByName.get(spec.name.toLowerCase()); |
| 134 | if (!labelId) { |
| 135 | throw new Error(`Label ${JSON.stringify(spec.name)} not found. Ensure the label exists in the target repository.`); |
| 136 | } |
| 137 | |
| 138 | return { |
| 139 | labelId, |
| 140 | ...normalizeIssueIntentMetadata(spec), |
| 141 | }; |
| 142 | }); |
| 143 | } |
| 144 | |
| 145 | module.exports = { |
| 146 | buildIssueIntentLabelUpdates, |
no test coverage detected