ctrl-fx 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-BDTTV33M.js → chunk-PHE3QHCS.js} +11 -11
- package/dist/index.js +1 -1
- package/dist/testing.js +1 -1
- package/dist/webcomponent.js +1 -1
- package/package.json +1 -1
|
@@ -1087,22 +1087,22 @@ function updateText(node, newText) {
|
|
|
1087
1087
|
node.realNode.nodeValue = newText;
|
|
1088
1088
|
}
|
|
1089
1089
|
function updateAttrs(node, newAttrs) {
|
|
1090
|
+
const oldAttrsMap = new Map(node.attrs.map((a) => [a.name, a]));
|
|
1090
1091
|
const newAttrsMap = new Map(newAttrs.map((a) => [a.name, a]));
|
|
1091
1092
|
node.attrs.forEach((oldAttr) => {
|
|
1092
|
-
|
|
1093
|
-
if (newAttr) {
|
|
1094
|
-
if (newAttr.value || oldAttr.value) {
|
|
1095
|
-
if (newAttr.value !== oldAttr.value) {
|
|
1096
|
-
node.realNode.setAttribute(
|
|
1097
|
-
newAttr.name,
|
|
1098
|
-
newAttr.value ? newAttr.value : ""
|
|
1099
|
-
);
|
|
1100
|
-
}
|
|
1101
|
-
}
|
|
1102
|
-
} else {
|
|
1093
|
+
if (!newAttrsMap.has(oldAttr.name)) {
|
|
1103
1094
|
node.realNode.removeAttribute(oldAttr.name);
|
|
1104
1095
|
}
|
|
1105
1096
|
});
|
|
1097
|
+
newAttrs.forEach((newAttr) => {
|
|
1098
|
+
const oldAttr = oldAttrsMap.get(newAttr.name);
|
|
1099
|
+
if (!oldAttr || newAttr.value !== oldAttr.value) {
|
|
1100
|
+
node.realNode.setAttribute(
|
|
1101
|
+
newAttr.name,
|
|
1102
|
+
newAttr.value ? newAttr.value : ""
|
|
1103
|
+
);
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
1106
|
node.attrs = newAttrs;
|
|
1107
1107
|
}
|
|
1108
1108
|
function updateProps(node, newProps) {
|
package/dist/index.js
CHANGED
package/dist/testing.js
CHANGED
package/dist/webcomponent.js
CHANGED