Skip to content

Commit 13ca98d

Browse files
committed
chore: build for production
1 parent 4dff24b commit 13ca98d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

dist/index.cjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,14 @@ const plugin = (options = {}) => (tree) => {
1818
if (k === "class" && node2.attrs && node2.attrs.class) {
1919
node2.attrs.class = [.../* @__PURE__ */ new Set([...node2.attrs.class.split(" "), ...v.split(" ")])].join(" ");
2020
} else {
21-
const attributesToOmit = Object.keys(node2.attrs || {});
22-
const { [attributesToOmit]: _, ...remainingAttributes } = options.attributes[key];
21+
const existingAttributes = node2.attrs || {};
22+
const remainingAttributes = Object.fromEntries(
23+
Object.entries(
24+
options.attributes[key]
25+
).filter(
26+
([attrKey]) => !(attrKey in existingAttributes)
27+
)
28+
);
2329
const attributes2 = options.overwrite ? options.attributes[key] : remainingAttributes;
2430
node2.attrs = { ...node2.attrs, ...attributes2 };
2531
}

dist/index.mjs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@ const plugin = (options = {}) => (tree) => {
1212
if (k === "class" && node2.attrs && node2.attrs.class) {
1313
node2.attrs.class = [.../* @__PURE__ */ new Set([...node2.attrs.class.split(" "), ...v.split(" ")])].join(" ");
1414
} else {
15-
const attributesToOmit = Object.keys(node2.attrs || {});
16-
const { [attributesToOmit]: _, ...remainingAttributes } = options.attributes[key];
15+
const existingAttributes = node2.attrs || {};
16+
const remainingAttributes = Object.fromEntries(
17+
Object.entries(
18+
options.attributes[key]
19+
).filter(
20+
([attrKey]) => !(attrKey in existingAttributes)
21+
)
22+
);
1723
const attributes2 = options.overwrite ? options.attributes[key] : remainingAttributes;
1824
node2.attrs = { ...node2.attrs, ...attributes2 };
1925
}

0 commit comments

Comments
 (0)