Skip to content

Commit 9f8c2b4

Browse files
committed
fixup! fixup! lib: optimize styleText when validateStream is false
1 parent 63d2996 commit 9f8c2b4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/util.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,13 @@ function styleText(format, text, options) {
196196
skipColorize = !lazyUtilColors().shouldColorize(stream);
197197
}
198198

199-
const isArray = ArrayIsArray(format);
200-
const formatArray = isArray ? format : [format];
199+
const formatArray = ArrayIsArray(format) ? format : [format];
201200

202201
let openCodes = '';
203202
let closeCodes = '';
204203
let processedText = text;
205204

206-
for (let i = 0; i < formatArray.length; i++) {
207-
const key = formatArray[i];
205+
for (const key of formatArray) {
208206
if (key === 'none') continue;
209207
const style = cache[key];
210208
if (style === undefined) {

0 commit comments

Comments
 (0)