@schukai/monster 3.51.1 → 3.51.3
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -64,8 +64,12 @@ function initOptionsFromAttributes(element, options, mapping = {}, prefix = "dat
|
|
64
64
|
value = mapping[optionName](value);
|
65
65
|
}
|
66
66
|
|
67
|
-
const
|
68
|
-
|
67
|
+
const optionValue = finder.getVia(optionName);
|
68
|
+
|
69
|
+
const typeOfOptionValue = typeof optionValue;
|
70
|
+
if (optionValue === null || optionValue === undefined) {
|
71
|
+
value = null;
|
72
|
+
} else if (typeOfOptionValue === "boolean") {
|
69
73
|
value = value === "true";
|
70
74
|
} else if (typeOfOptionValue === "number") {
|
71
75
|
value = Number(value);
|
package/source/types/version.mjs
CHANGED
@@ -5,14 +5,14 @@
|
|
5
5
|
* License text available at https://www.gnu.org/licenses/agpl-3.0.en.html
|
6
6
|
*/
|
7
7
|
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
11
|
-
import {
|
12
|
-
import {
|
13
|
-
import {
|
8
|
+
import {internalSymbol} from "../constants.mjs";
|
9
|
+
import {Base} from "../types/base.mjs";
|
10
|
+
import {getGlobalFunction} from "../types/global.mjs";
|
11
|
+
import {isFunction, isInteger} from "../types/is.mjs";
|
12
|
+
import {Queue} from "../types/queue.mjs";
|
13
|
+
import {validateFunction, validateInteger} from "../types/validate.mjs";
|
14
14
|
|
15
|
-
export {
|
15
|
+
export {Processing};
|
16
16
|
|
17
17
|
/**
|
18
18
|
* @private
|
@@ -86,9 +86,8 @@ class Processing extends Base {
|
|
86
86
|
*
|
87
87
|
* So the execution time is timeout1+timeout1+timeout1+timeout2
|
88
88
|
*
|
89
|
-
* @param {int} timeout Timeout
|
90
|
-
* @param {function} callback Callback
|
91
89
|
* @throw {TypeError} the arguments must be either integer or functions
|
90
|
+
* @param {...(int|function)} args
|
92
91
|
*/
|
93
92
|
constructor(...args) {
|
94
93
|
super();
|
@@ -136,13 +135,17 @@ class Processing extends Base {
|
|
136
135
|
*/
|
137
136
|
run(data) {
|
138
137
|
const self = this;
|
139
|
-
if (
|
138
|
+
if (self[internalSymbol].queue.isEmpty()) {
|
140
139
|
return Promise.resolve(data);
|
141
140
|
}
|
142
141
|
|
143
|
-
|
144
|
-
|
145
|
-
|
142
|
+
const callback = self[internalSymbol].queue.poll();
|
143
|
+
|
144
|
+
if (callback === null || callback === undefined) {
|
145
|
+
return Promise.resolve(data);
|
146
|
+
}
|
147
|
+
|
148
|
+
return callback.run(data)
|
146
149
|
.then((result) => {
|
147
150
|
return self.run(result);
|
148
151
|
});
|
package/test/cases/monster.mjs
CHANGED