Skip to content

Commit 10facb7

Browse files
committed
util: skip getHexStyle() when colorization is disabled
1 parent 3c455e0 commit 10facb7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/util.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ function styleText(format, text, options) {
287287
throw new ERR_INVALID_ARG_VALUE('format', key,
288288
'must be a valid hex color (#RGB or #RRGGBB)');
289289
}
290+
if (skipColorize) continue;
290291
hexStyle = getHexStyle(key);
292+
} else if (skipColorize) {
293+
continue;
291294
}
292-
if (skipColorize) continue;
293295
openCodes += hexStyle.openSeq;
294296
closeCodes = hexStyle.closeSeq + closeCodes;
295297
processedText = replaceCloseCode(processedText, hexStyle.closeSeq, hexStyle.openSeq, false);

0 commit comments

Comments
 (0)