Skip to content

Commit

Permalink
fix(utils): pass false attribute value as is
Browse files Browse the repository at this point in the history
  • Loading branch information
borisdiakur committed May 29, 2021
1 parent 5efb7e3 commit 3584956
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/liquid/utils/cloneAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ export function cloneAttributes<T = HTMLAttributes | NamedNodeMap>(el: {
})
return Object.values(<T>attrClone).reduce((acc: T, attr: Attr): T => {
if (!attr.name) return acc
if (attr.value === 'false') {
acc[attr.name] = false
} else {
acc[attr.name] = attr.value || true
}
acc[attr.name] = attr.value || true
return acc
}, {})
}

0 comments on commit 3584956

Please sign in to comment.