Skip to content

Commit e0c3df8

Browse files
committed
Simplify condition
1 parent f8b0e92 commit e0c3df8

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Generator.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export function cssToHtml(css: CSSRuleList | string): HTMLBodyElement {
6060
else if (descriptor.addressCharacter === '#') {
6161
descriptor.id += character;
6262
}
63-
6463
descriptor.previousCharacter = character;
6564
},
6665
clear: (): void => {
@@ -77,9 +76,7 @@ export function cssToHtml(css: CSSRuleList | string): HTMLBodyElement {
7776
const newElement = document.createElement(descriptor.tag || 'div');
7877
// Add the classes.
7978
for (const c of descriptor.classes) {
80-
if (c) {
81-
newElement.classList.add(c);
82-
}
79+
(c && newElement.classList.add(c));
8380
}
8481
// Add the ID.
8582
if (descriptor.id) {

0 commit comments

Comments
 (0)