Skip to content

Commit 503e1a5

Browse files
committed
chore: build for production
1 parent 64654f4 commit 503e1a5

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

dist/index.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
'use strict';
22

3-
const omit = require('lodash.omit');
43
const matchHelper = require('posthtml-match-helper');
54

65
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
76

8-
const omit__default = /*#__PURE__*/_interopDefaultCompat(omit);
97
const matchHelper__default = /*#__PURE__*/_interopDefaultCompat(matchHelper);
108

119
const plugin = (options = {}) => (tree) => {
@@ -20,7 +18,9 @@ const plugin = (options = {}) => (tree) => {
2018
if (k === "class" && node2.attrs && node2.attrs.class) {
2119
node2.attrs.class = [.../* @__PURE__ */ new Set([...node2.attrs.class.split(" "), ...v.split(" ")])].join(" ");
2220
} else {
23-
const attributes2 = options.overwrite ? options.attributes[key] : omit__default(options.attributes[key], Object.keys(node2.attrs || {}));
21+
const attributesToOmit = Object.keys(node2.attrs || {});
22+
const { [attributesToOmit]: _, ...remainingAttributes } = options.attributes[key];
23+
const attributes2 = options.overwrite ? options.attributes[key] : remainingAttributes;
2424
node2.attrs = { ...node2.attrs, ...attributes2 };
2525
}
2626
}

dist/index.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import omit from 'lodash.omit';
21
import matchHelper from 'posthtml-match-helper';
32

43
const plugin = (options = {}) => (tree) => {
@@ -13,7 +12,9 @@ const plugin = (options = {}) => (tree) => {
1312
if (k === "class" && node2.attrs && node2.attrs.class) {
1413
node2.attrs.class = [.../* @__PURE__ */ new Set([...node2.attrs.class.split(" "), ...v.split(" ")])].join(" ");
1514
} else {
16-
const attributes2 = options.overwrite ? options.attributes[key] : omit(options.attributes[key], Object.keys(node2.attrs || {}));
15+
const attributesToOmit = Object.keys(node2.attrs || {});
16+
const { [attributesToOmit]: _, ...remainingAttributes } = options.attributes[key];
17+
const attributes2 = options.overwrite ? options.attributes[key] : remainingAttributes;
1718
node2.attrs = { ...node2.attrs, ...attributes2 };
1819
}
1920
}

0 commit comments

Comments
 (0)