Skip to content

Commit

Permalink
feat(cloneAttributes): test for name, exclude part
Browse files Browse the repository at this point in the history
  • Loading branch information
renet committed Oct 14, 2021
1 parent 54b1dcb commit caf5270
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/liquid/utils/cloneAttributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { JSXBase } from '@stencil/core/internal'

export const cloneAttributes = <B extends HTMLElement>(el: B) =>
Object.values(el.attributes).reduce<JSXBase.HTMLAttributes<B>>(
(acc, attr) => {
if (['style', 'id', 'class', 'slot'].includes(attr.name)) {
(acc, { name, value }) => {
if (!name || ['style', 'id', 'class', 'slot', 'part'].includes(name)) {
return acc
}

acc[attr.name] = attr.value || true
acc[name] = value || true

return acc
},
Expand Down

0 comments on commit caf5270

Please sign in to comment.