@schukai/monster 4.37.2 → 4.38.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.
@@ -1031,8 +1031,10 @@ function getOptionsFromScriptTag() {
1031
1031
  * @return {object}
1032
1032
  */
1033
1033
  function getOptionsFromAttributes() {
1034
-
1035
- if(this.hasAttribute(ATTRIBUTE_DISABLED) && this.getAttribute(ATTRIBUTE_DISABLED) !== null) {
1034
+ if (
1035
+ this.hasAttribute(ATTRIBUTE_DISABLED) &&
1036
+ this.getAttribute(ATTRIBUTE_DISABLED) !== null
1037
+ ) {
1036
1038
  this.setOption(ATTRIBUTE_DISABLED, true);
1037
1039
  } else {
1038
1040
  this.setOption(ATTRIBUTE_DISABLED, undefined);
@@ -25,11 +25,11 @@ export { resetErrorAttribute, addErrorAttribute, removeErrorAttribute };
25
25
  * @return {HTMLElement}
26
26
  */
27
27
  function resetErrorAttribute(element) {
28
- validateInstance(element, HTMLElement);
29
- if (element.hasAttribute(ATTRIBUTE_ERRORMESSAGE)) {
30
- element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);
31
- }
32
- return element;
28
+ validateInstance(element, HTMLElement);
29
+ if (element.hasAttribute(ATTRIBUTE_ERRORMESSAGE)) {
30
+ element.removeAttribute(ATTRIBUTE_ERRORMESSAGE);
31
+ }
32
+ return element;
33
33
  }
34
34
 
35
35
  /**
@@ -43,45 +43,45 @@ function resetErrorAttribute(element) {
43
43
  * @return {HTMLElement}
44
44
  */
45
45
  function addErrorAttribute(element, message) {
46
- validateInstance(element, HTMLElement);
46
+ validateInstance(element, HTMLElement);
47
47
 
48
- if (message instanceof Error) {
49
- message = message.message;
50
- }
48
+ if (message instanceof Error) {
49
+ message = message.message;
50
+ }
51
51
 
52
- if (typeof message !== "string") {
53
- if (typeof message === "object" && message !== null) {
54
- if (typeof message.toString === "function") {
55
- message = message.toString();
56
- } else {
57
- message = JSON.stringify(message);
58
- }
59
- } else {
60
- message = String(message);
61
- }
62
- }
52
+ if (typeof message !== "string") {
53
+ if (typeof message === "object" && message !== null) {
54
+ if (typeof message.toString === "function") {
55
+ message = message.toString();
56
+ } else {
57
+ message = JSON.stringify(message);
58
+ }
59
+ } else {
60
+ message = String(message);
61
+ }
62
+ }
63
63
 
64
- validateString(message);
64
+ validateString(message);
65
65
 
66
- if (!element.hasAttribute(ATTRIBUTE_ERRORMESSAGE)) {
67
- element.setAttribute(ATTRIBUTE_ERRORMESSAGE, message);
68
- return element;
69
- }
66
+ if (!element.hasAttribute(ATTRIBUTE_ERRORMESSAGE)) {
67
+ element.setAttribute(ATTRIBUTE_ERRORMESSAGE, message);
68
+ return element;
69
+ }
70
70
 
71
- const current = element.getAttribute(ATTRIBUTE_ERRORMESSAGE);
72
- const list = current.split("::");
71
+ const current = element.getAttribute(ATTRIBUTE_ERRORMESSAGE);
72
+ const list = current.split("::");
73
73
 
74
- for (let i = 0; i < list.length; i++) {
75
- if (list[i] === message) {
76
- return element;
77
- }
78
- }
74
+ for (let i = 0; i < list.length; i++) {
75
+ if (list[i] === message) {
76
+ return element;
77
+ }
78
+ }
79
79
 
80
- list.push(message);
80
+ list.push(message);
81
81
 
82
- element.setAttribute(ATTRIBUTE_ERRORMESSAGE, list.join("::"));
82
+ element.setAttribute(ATTRIBUTE_ERRORMESSAGE, list.join("::"));
83
83
 
84
- return element;
84
+ return element;
85
85
  }
86
86
 
87
87
  /**
@@ -95,20 +95,20 @@ function addErrorAttribute(element, message) {
95
95
  * @return {HTMLElement}
96
96
  */
97
97
  function removeErrorAttribute(element, message) {
98
- validateInstance(element, HTMLElement);
99
- validateString(message);
98
+ validateInstance(element, HTMLElement);
99
+ validateString(message);
100
100
 
101
- if (!element.hasAttribute(ATTRIBUTE_ERRORMESSAGE)) {
102
- return element;
103
- }
101
+ if (!element.hasAttribute(ATTRIBUTE_ERRORMESSAGE)) {
102
+ return element;
103
+ }
104
104
 
105
- const current = element.getAttribute(ATTRIBUTE_ERRORMESSAGE);
106
- const list = current.split("::");
107
- const newList = list.filter(function (token) {
108
- return token !== message;
109
- });
105
+ const current = element.getAttribute(ATTRIBUTE_ERRORMESSAGE);
106
+ const list = current.split("::");
107
+ const newList = list.filter(function (token) {
108
+ return token !== message;
109
+ });
110
110
 
111
- element.setAttribute(ATTRIBUTE_ERRORMESSAGE, newList.join("::"));
111
+ element.setAttribute(ATTRIBUTE_ERRORMESSAGE, newList.join("::"));
112
112
 
113
- return element;
113
+ return element;
114
114
  }
@@ -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.37.1");
159
+ monsterVersion = new Version("4.38.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.37.1")
10
+ monsterVersion = new Version("4.38.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.37.1</h1>
13
- <div id="lastupdate" style='font-size:0.7em'>last update Sa 19. Jul 19:26:49 CEST 2025</div>
12
+ <h1 style='margin-bottom: 0.1em;'>Monster 4.38.0</h1>
13
+ <div id="lastupdate" style='font-size:0.7em'>last update Mi 23. Jul 15:15:52 CEST 2025</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>