From 9af3897f2e119a8957c579d5b8badfabf14744f9 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Mon, 5 Dec 2022 23:03:49 -0600 Subject: [PATCH] chore: clean up code --- src/Tokenizer.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tokenizer.js b/src/Tokenizer.js index 3100c2579bf..21c0f20b542 100644 --- a/src/Tokenizer.js +++ b/src/Tokenizer.js @@ -319,7 +319,7 @@ export class Tokenizer { if (!list.loose) { // Check if list should be loose const spacers = list.items[i].tokens.filter(t => t.type === 'space'); - const hasMultipleLineBreaks = spacers.length && spacers.every(t => { + const hasMultipleLineBreaks = spacers.length > 0 && spacers.every(t => { const chars = t.raw.split(''); let lineBreaks = 0; for (const char of chars) { @@ -334,7 +334,7 @@ export class Tokenizer { return false; }); - list.loose = !!hasMultipleLineBreaks; + list.loose = hasMultipleLineBreaks; } }