Remove duplicate normalizeColor calls (#5534)
* Remove duplicate normalizeColor calls * Clarify behaviour with comment
This commit is contained in:
@@ -23,17 +23,16 @@ module.exports = function makeBadge({
|
||||
|
||||
const [label, message] = text
|
||||
|
||||
color = normalizeColor(color)
|
||||
labelColor = normalizeColor(labelColor)
|
||||
|
||||
// This ought to be the responsibility of the server, not `makeBadge`.
|
||||
if (format === 'json') {
|
||||
return JSON.stringify({
|
||||
label,
|
||||
message,
|
||||
logoWidth,
|
||||
color,
|
||||
labelColor,
|
||||
// Only call normalizeColor for the JSON case: this is handled
|
||||
// internally by toSvgColor in the SVG case.
|
||||
color: normalizeColor(color),
|
||||
labelColor: normalizeColor(labelColor),
|
||||
link: links,
|
||||
name: label,
|
||||
value: message,
|
||||
|
||||
Reference in New Issue
Block a user