@schukai/monster 3.31.0 → 3.31.1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/source/dom/updater.mjs +10 -1
- package/source/types/version.mjs +1 -1
- package/test/cases/monster.mjs +1 -1
package/package.json
CHANGED
package/source/dom/updater.mjs
CHANGED
@@ -291,6 +291,7 @@ function retrieveAndSetValue(element) {
|
|
291
291
|
const pathfinder = new Pathfinder(self[internalSymbol].subject.getSubject());
|
292
292
|
|
293
293
|
let path = element.getAttribute(ATTRIBUTE_UPDATER_BIND);
|
294
|
+
if (path === null) throw new Error("the bind argument must start as a value with a path");
|
294
295
|
|
295
296
|
if (path.indexOf("path:") !== 0) {
|
296
297
|
throw new Error("the bind argument must start as a value with a path");
|
@@ -434,6 +435,8 @@ function insertElement(change) {
|
|
434
435
|
found = true;
|
435
436
|
|
436
437
|
const attributes = containerElement.getAttribute(ATTRIBUTE_UPDATER_INSERT);
|
438
|
+
if (attributes === null) continue;
|
439
|
+
|
437
440
|
let def = trimSpaces(attributes);
|
438
441
|
let i = def.indexOf(" ");
|
439
442
|
let key = trimSpaces(def.substr(0, i));
|
@@ -489,6 +492,7 @@ function insertElement(change) {
|
|
489
492
|
let nodes = containerElement.querySelectorAll(
|
490
493
|
`[${ATTRIBUTE_UPDATER_INSERT_REFERENCE}*="${refPrefix}"]`,
|
491
494
|
);
|
495
|
+
|
492
496
|
for (const [, node] of Object.entries(nodes)) {
|
493
497
|
if (!available.has(node.getAttribute(ATTRIBUTE_UPDATER_INSERT_REFERENCE))) {
|
494
498
|
try {
|
@@ -699,7 +703,7 @@ function runUpdateAttributes(container, parts, subject) {
|
|
699
703
|
|
700
704
|
let iterator = new Set();
|
701
705
|
|
702
|
-
const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="i18n:"]`;
|
706
|
+
const query = `[${ATTRIBUTE_UPDATER_SELECT_THIS}][${ATTRIBUTE_UPDATER_ATTRIBUTES}], [${ATTRIBUTE_UPDATER_ATTRIBUTES}*="path:${current}"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="static:"], [${ATTRIBUTE_UPDATER_ATTRIBUTES}^="i18n:"]`;
|
703
707
|
|
704
708
|
const e = container.querySelectorAll(query);
|
705
709
|
|
@@ -715,6 +719,11 @@ function runUpdateAttributes(container, parts, subject) {
|
|
715
719
|
if (mem.has(element)) return;
|
716
720
|
mem.add(element);
|
717
721
|
|
722
|
+
// this case occurs when the ATTRIBUTE_UPDATER_SELECT_THIS attribute is set
|
723
|
+
if (!element.hasAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES)) {
|
724
|
+
continue;
|
725
|
+
}
|
726
|
+
|
718
727
|
const attributes = element.getAttribute(ATTRIBUTE_UPDATER_ATTRIBUTES);
|
719
728
|
|
720
729
|
for (let [, def] of Object.entries(attributes.split(","))) {
|
package/source/types/version.mjs
CHANGED
package/test/cases/monster.mjs
CHANGED