From 90a33dfb742d58797da6a672f1ca9c749ac5542c Mon Sep 17 00:00:00 2001 From: Roger Tuan Date: Mon, 9 Dec 2024 09:45:01 -0800 Subject: [PATCH] Remove comments that were screwing with formatting --- src/lib/util/headTagToEscapedStrings.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/lib/util/headTagToEscapedStrings.ts b/src/lib/util/headTagToEscapedStrings.ts index 8f68d4d..3f82d67 100644 --- a/src/lib/util/headTagToEscapedStrings.ts +++ b/src/lib/util/headTagToEscapedStrings.ts @@ -16,14 +16,9 @@ export const headTagsToEscapedStrings = (headTags: SupportedHeadTags): string[] const serializedAttributes: string[] = attributes && typeof attributes === 'object' - ? Object.entries(attributes) // Object.entries enumerates only the object's own props, not inherited ones - .flatMap(([key, value]) => - value - ? // Escape key & value and concat them into an attribute - `${escapeHtmlString(key)}="${escapeHtmlString(value)}"` - : // Or skip empty values by returning blank array to flatMap - [] - ) + ? Object.entries(attributes).flatMap(([key, value]) => + value ? `${escapeHtmlString(key)}="${escapeHtmlString(value)}"` : [] + ) : []; const attributesString: string =