@schukai/monster 3.31.0 → 3.31.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schukai/monster",
3
- "version": "3.31.0",
3
+ "version": "3.31.1",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -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(","))) {
@@ -142,7 +142,7 @@ function getMonsterVersion() {
142
142
  }
143
143
 
144
144
  /** don't touch, replaced by make with package.json version */
145
- monsterVersion = new Version("3.31.0");
145
+ monsterVersion = new Version("3.31.1");
146
146
 
147
147
  return monsterVersion;
148
148
  }
@@ -7,7 +7,7 @@ describe('Monster', function () {
7
7
  let monsterVersion
8
8
 
9
9
  /** don´t touch, replaced by make with package.json version */
10
- monsterVersion = new Version("3.31.0")
10
+ monsterVersion = new Version("3.31.1")
11
11
 
12
12
  let m = getMonsterVersion();
13
13