* Validate one issue field name against configured allowed-fields. * @param {string} fieldName * @param {string[]} allowedFields * @returns {void}
(fieldName, allowedFields)
| 32 | * @returns {void} |
| 33 | */ |
| 34 | function validateAllowedIssueFieldName(fieldName, allowedFields) { |
| 35 | if (!fieldName) return; |
| 36 | const fieldSet = buildAllowedFieldSet(allowedFields); |
| 37 | if (!fieldSet) return; |
| 38 | if (!fieldSet.has(fieldName.toLowerCase())) { |
| 39 | throw new Error(`${ERR_VALIDATION}: issue field "${fieldName}" is not in the allowed-fields list: ${allowedFields.join(", ")}`); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Validate requested issue fields against configured allowed-fields. |
no test coverage detected