@schukai/monster 3.51.2 → 3.51.3

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.51.2",
3
+ "version": "3.51.3",
4
4
  "description": "Monster is a simple library for creating fast, robust and lightweight websites.",
5
5
  "keywords": [
6
6
  "framework",
@@ -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.51.2");
145
+ monsterVersion = new Version("3.51.3");
146
146
 
147
147
  return monsterVersion;
148
148
  }
@@ -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 { 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";
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 { Processing };
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 (this[internalSymbol].queue.isEmpty()) {
138
+ if (self[internalSymbol].queue.isEmpty()) {
140
139
  return Promise.resolve(data);
141
140
  }
142
141
 
143
- return this[internalSymbol].queue
144
- .poll()
145
- .run(data)
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
  });
@@ -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.51.2")
10
+ monsterVersion = new Version("3.51.3")
11
11
 
12
12
  let m = getMonsterVersion();
13
13