@schukai/monster 4.69.1 → 4.70.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.
@@ -13,7 +13,15 @@
13
13
  */
14
14
 
15
15
  import { Pathfinder } from "../../data/pathfinder.mjs";
16
- import { isFunction } from "../../types/is.mjs";
16
+ import {
17
+ isFunction,
18
+ isBoolean,
19
+ isString,
20
+ isObject,
21
+ isNumber,
22
+ isArray,
23
+ isInteger,
24
+ } from "../../types/is.mjs";
17
25
  import { attributeObserverSymbol } from "../customelement.mjs";
18
26
  import { extractKeys } from "./extract-keys.mjs";
19
27
 
@@ -77,15 +85,27 @@ function setOptionFromAttribute(
77
85
  value = mapping[optionName](value);
78
86
  }
79
87
 
80
- const typeOfOptionValue = typeof finder.getVia(optionName);
81
- if (typeOfOptionValue === "boolean") {
88
+ let optionValue = finder.getVia(optionName);
89
+ if (optionValue === null || optionValue === undefined) {
90
+ optionValue = value;
91
+ }
92
+
93
+ if (optionValue === null || optionValue === undefined) {
94
+ value = null;
95
+ } else if (isBoolean(optionValue)) {
82
96
  value = value === "true";
83
- } else if (typeOfOptionValue === "number") {
97
+ } else if (isInteger(optionValue)) {
98
+ value = Number(value);
99
+ } else if (isNumber(optionValue)) {
84
100
  value = Number(value);
85
- } else if (typeOfOptionValue === "string") {
101
+ } else if (isString(optionValue)) {
86
102
  value = String(value);
87
- } else if (typeOfOptionValue === "object") {
103
+ } else if (isObject(optionValue)) {
88
104
  value = JSON.parse(value);
105
+ } else if (isArray(optionValue)) {
106
+ value = value.split("::");
107
+ } else {
108
+ value = optionValue;
89
109
  }
90
110
 
91
111
  finder.setVia(optionName, value);
@@ -156,7 +156,7 @@ function getMonsterVersion() {
156
156
  }
157
157
 
158
158
  /** don't touch, replaced by make with package.json version */
159
- monsterVersion = new Version("4.68.0");
159
+ monsterVersion = new Version("4.70.0");
160
160
 
161
161
  return monsterVersion;
162
162
  }
@@ -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("4.68.0")
10
+ monsterVersion = new Version("4.70.0")
11
11
 
12
12
  let m = getMonsterVersion();
13
13
 
@@ -9,8 +9,8 @@
9
9
  </head>
10
10
  <body>
11
11
  <div id="headline" style="display: flex;align-items: center;justify-content: center;flex-direction: column;">
12
- <h1 style='margin-bottom: 0.1em;'>Monster 4.68.0</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update Fr 2. Jan 17:20:55 CET 2026</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 4.70.0</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update Sa 3. Jan 03:58:16 CET 2026</div>
14
14
  </div>
15
15
  <div id="mocha-errors"
16
16
  style="color: red;font-weight: bold;display: flex;align-items: center;justify-content: center;flex-direction: column;margin:20px;"></div>