Skip to content

Commit

Permalink
Remove comments that were screwing with formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
arcataroger committed Dec 9, 2024
1 parent 2688f90 commit 90a33df
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/lib/util/headTagToEscapedStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 90a33df

Please sign in to comment.