Skip to content

Commit

Permalink
cjs confuses me
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri Luzon committed Mar 13, 2024
1 parent a7d7c53 commit 3b96105
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cjs/interface/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Attr extends Node {

toString() {
const {name, [VALUE]: value} = this;
if (emptyAttributes.has(name) && !value) {
return ignoreCase(this) ? name : `${name}=""`;
if (!value) {
return emptyAttributes.has(name) && ignoreCase(this) ? name : `${name}=""`;
}
const escapedValue = ignoreCase(this) ? value.replace(QUOTE, '"') : escape(value);
return `${name}="${escapedValue}"`;
Expand Down
4 changes: 2 additions & 2 deletions esm/interface/attr.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ export class Attr extends Node {

toString() {
const {name, [VALUE]: value} = this;
if (emptyAttributes.has(name) && !value) {
return ignoreCase(this) ? name : `${name}=""`;
if (!value) {
return emptyAttributes.has(name) && ignoreCase(this) ? name : `${name}=""`;
}
const escapedValue = ignoreCase(this) ? value.replace(QUOTE, '"') : escape(value);
return `${name}="${escapedValue}"`;
Expand Down

0 comments on commit 3b96105

Please sign in to comment.