@schukai/monster 1.15.0 → 1.15.2
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG +6 -0
- package/README.md +5 -5
- package/dist/modules/constants.js +1 -1
- package/dist/modules/constraints/abstract.js +2 -2
- package/dist/modules/constraints/abstractoperator.js +2 -2
- package/dist/modules/constraints/andoperator.js +2 -2
- package/dist/modules/constraints/invalid.js +2 -2
- package/dist/modules/constraints/isarray.js +2 -2
- package/dist/modules/constraints/isobject.js +2 -2
- package/dist/modules/constraints/namespace.js +1 -1
- package/dist/modules/constraints/oroperator.js +2 -2
- package/dist/modules/constraints/valid.js +2 -2
- package/dist/modules/data/buildmap.js +2 -2
- package/dist/modules/data/diff.js +2 -2
- package/dist/modules/data/extend.js +2 -2
- package/dist/modules/data/namespace.js +1 -1
- package/dist/modules/data/pathfinder.js +2 -2
- package/dist/modules/data/pipe.js +2 -2
- package/dist/modules/data/transformer.js +2 -2
- package/dist/modules/dom/assembler.js +2 -2
- package/dist/modules/dom/attributes.js +2 -2
- package/dist/modules/dom/constants.js +2 -2
- package/dist/modules/dom/customcontrol.js +2 -2
- package/dist/modules/dom/customelement.js +2 -2
- package/dist/modules/dom/events.js +2 -2
- package/dist/modules/dom/locale.js +2 -2
- package/dist/modules/dom/namespace.js +1 -1
- package/dist/modules/dom/template.js +2 -2
- package/dist/modules/dom/theme.js +2 -2
- package/dist/modules/dom/updater.js +2 -2
- package/dist/modules/dom/util.js +2 -2
- package/dist/modules/i18n/locale.js +2 -2
- package/dist/modules/i18n/namespace.js +1 -1
- package/dist/modules/i18n/provider.js +2 -2
- package/dist/modules/i18n/providers/fetch.js +2 -2
- package/dist/modules/i18n/providers/namespace.js +1 -1
- package/dist/modules/i18n/translations.js +2 -2
- package/dist/modules/logging/handler/console.js +2 -2
- package/dist/modules/logging/handler/namespace.js +1 -1
- package/dist/modules/logging/handler.js +2 -2
- package/dist/modules/logging/logentry.js +2 -2
- package/dist/modules/logging/logger.js +2 -2
- package/dist/modules/logging/namespace.js +1 -1
- package/dist/modules/math/namespace.js +1 -1
- package/dist/modules/math/random.js +2 -2
- package/dist/modules/monster.js +2 -2
- package/dist/modules/namespace.js +2 -2
- package/dist/modules/text/formatter.js +2 -2
- package/dist/modules/text/namespace.js +1 -1
- package/dist/modules/types/base.js +2 -2
- package/dist/modules/types/basewithoptions.js +2 -2
- package/dist/modules/types/global.js +2 -2
- package/dist/modules/types/id.js +2 -2
- package/dist/modules/types/is.js +2 -2
- package/dist/modules/types/namespace.js +1 -1
- package/dist/modules/types/observer.js +2 -2
- package/dist/modules/types/observerlist.js +2 -2
- package/dist/modules/types/proxyobserver.js +2 -2
- package/dist/modules/types/queue.js +2 -2
- package/dist/modules/types/randomid.js +2 -2
- package/dist/modules/types/stack.js +2 -2
- package/dist/modules/types/tokenlist.js +2 -2
- package/dist/modules/types/typeof.js +2 -2
- package/dist/modules/types/uniquequeue.js +2 -2
- package/dist/modules/types/validate.js +2 -2
- package/dist/modules/types/version.js +2 -2
- package/dist/modules/util/clone.js +2 -2
- package/dist/modules/util/comparator.js +2 -2
- package/dist/modules/util/freeze.js +2 -2
- package/dist/modules/util/namespace.js +1 -1
- package/dist/monster.dev.js +7321 -7322
- package/dist/monster.dev.js.map +1 -1
- package/dist/monster.js +2 -9
- package/package.json +1 -1
- package/source/constraints/abstract.js +1 -1
- package/source/constraints/abstractoperator.js +2 -2
- package/source/constraints/andoperator.js +7 -7
- package/source/constraints/invalid.js +4 -4
- package/source/constraints/isarray.js +6 -6
- package/source/constraints/isobject.js +6 -6
- package/source/constraints/namespace.js +2 -2
- package/source/constraints/oroperator.js +7 -7
- package/source/constraints/valid.js +6 -6
- package/source/data/buildmap.js +3 -3
- package/source/data/diff.js +8 -8
- package/source/data/extend.js +6 -6
- package/source/data/namespace.js +2 -2
- package/source/data/pathfinder.js +12 -12
- package/source/data/pipe.js +7 -7
- package/source/data/transformer.js +9 -9
- package/source/dom/assembler.js +6 -6
- package/source/dom/attributes.js +26 -27
- package/source/dom/constants.js +1 -1
- package/source/dom/customcontrol.js +80 -82
- package/source/dom/customelement.js +87 -87
- package/source/dom/events.js +7 -7
- package/source/dom/locale.js +4 -4
- package/source/dom/namespace.js +2 -2
- package/source/dom/template.js +23 -18
- package/source/dom/theme.js +7 -8
- package/source/dom/updater.js +18 -23
- package/source/dom/util.js +10 -10
- package/source/i18n/locale.js +5 -5
- package/source/i18n/namespace.js +1 -1
- package/source/i18n/provider.js +4 -4
- package/source/i18n/providers/fetch.js +7 -7
- package/source/i18n/translations.js +4 -4
- package/source/logging/handler/console.js +4 -4
- package/source/logging/handler/namespace.js +1 -1
- package/source/logging/handler.js +7 -7
- package/source/logging/logentry.js +4 -4
- package/source/logging/logger.js +4 -4
- package/source/logging/namespace.js +2 -2
- package/source/math/namespace.js +2 -2
- package/source/math/random.js +4 -4
- package/source/monster.js +42 -44
- package/source/namespace.js +2 -2
- package/source/text/formatter.js +5 -5
- package/source/text/namespace.js +1 -1
- package/source/types/base.js +3 -3
- package/source/types/basewithoptions.js +7 -7
- package/source/types/global.js +6 -6
- package/source/types/id.js +5 -5
- package/source/types/is.js +21 -21
- package/source/types/namespace.js +2 -2
- package/source/types/observer.js +6 -6
- package/source/types/observerlist.js +3 -3
- package/source/types/proxyobserver.js +21 -21
- package/source/types/queue.js +4 -4
- package/source/types/randomid.js +5 -5
- package/source/types/stack.js +3 -3
- package/source/types/tokenlist.js +8 -8
- package/source/types/typeof.js +4 -4
- package/source/types/uniquequeue.js +7 -7
- package/source/types/validate.js +26 -26
- package/source/types/version.js +7 -7
- package/source/util/clone.js +5 -5
- package/source/util/comparator.js +6 -6
- package/source/util/freeze.js +6 -6
- package/source/util/namespace.js +2 -2
- package/test/cases/dom/template.js +40 -1
- package/test/cases/monster.js +1 -1
- package/test/web/monster-dev.html +3 -3
- package/test/web/monster.html +2 -2
- package/test/web/test.html +3 -3
- package/test/web/tests.js +2 -2
package/source/types/global.js
CHANGED
@@ -4,8 +4,8 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
8
|
-
import {validateFunction,
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
|
+
import {validateFunction, validateObject, validateString} from "./validate.js";
|
9
9
|
|
10
10
|
/**
|
11
11
|
* @type {objec}
|
@@ -78,7 +78,7 @@ function getGlobal() {
|
|
78
78
|
*
|
79
79
|
* ```
|
80
80
|
* <script type="module">
|
81
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
81
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/global.js';
|
82
82
|
* console.log(Monster.Types.getGlobalObject('document')) // ↦ { }
|
83
83
|
* </script>
|
84
84
|
* ```
|
@@ -87,7 +87,7 @@ function getGlobal() {
|
|
87
87
|
*
|
88
88
|
* ```
|
89
89
|
* <script type="module">
|
90
|
-
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
90
|
+
* import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/global.js';
|
91
91
|
* console.log(getGlobalObject('document')) // ↦ { }
|
92
92
|
* </script>
|
93
93
|
* ```
|
@@ -115,7 +115,7 @@ function getGlobalObject(name) {
|
|
115
115
|
*
|
116
116
|
* ```
|
117
117
|
* <script type="module">
|
118
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
118
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/global.js';
|
119
119
|
* console.log(Monster.Types.getGlobalFunction('parseInt')) // ↦ f parseInt() { }
|
120
120
|
* </script>
|
121
121
|
* ```
|
@@ -124,7 +124,7 @@ function getGlobalObject(name) {
|
|
124
124
|
*
|
125
125
|
* ```
|
126
126
|
* <script type="module">
|
127
|
-
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
127
|
+
* import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/global.js';
|
128
128
|
* console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }
|
129
129
|
* </script>
|
130
130
|
* ```
|
package/source/types/id.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import {
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
|
+
import {Base} from './base.js';
|
8
8
|
import {validateString} from "./validate.js";
|
9
9
|
|
10
10
|
/**
|
@@ -23,8 +23,8 @@ let internalCounter = new Map;
|
|
23
23
|
* You can call the method via the monster namespace `new Monster.Types.ID()`.
|
24
24
|
*
|
25
25
|
* ```
|
26
|
-
* <script type="module">
|
27
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
26
|
+
* <script type="module">
|
27
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/id.js';
|
28
28
|
* console.log(new Monster.Types.ID())
|
29
29
|
* </script>
|
30
30
|
* ```
|
@@ -33,7 +33,7 @@ let internalCounter = new Map;
|
|
33
33
|
*
|
34
34
|
* ```
|
35
35
|
* <script type="module">
|
36
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
36
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/id.js';
|
37
37
|
* console.log(new ID())
|
38
38
|
* </script>
|
39
39
|
* ```
|
package/source/types/is.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
8
|
|
9
9
|
/**
|
10
10
|
* With this function you can check if a value is iterable
|
@@ -13,7 +13,7 @@ import {Monster, assignToNamespace} from '../namespace.js';
|
|
13
13
|
*
|
14
14
|
* ```
|
15
15
|
* <script type="module">
|
16
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
16
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
17
17
|
* console.log(Monster.Types.isIterable(null)) // ↦ false
|
18
18
|
* console.log(Monster.Types.isIterable('hello')) // ↦ true
|
19
19
|
* console.log(Monster.Types.isIterable([])) // ↦ true
|
@@ -24,7 +24,7 @@ import {Monster, assignToNamespace} from '../namespace.js';
|
|
24
24
|
*
|
25
25
|
* ```
|
26
26
|
* <script type="module">
|
27
|
-
* import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
27
|
+
* import {isIterable} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
28
28
|
* console.log(isIterable(null)) // ↦ false
|
29
29
|
* console.log(isIterable('hello')) // ↦ true
|
30
30
|
* console.log(isIterable([])) // ↦ true
|
@@ -51,7 +51,7 @@ function isIterable(value) {
|
|
51
51
|
*
|
52
52
|
* ```
|
53
53
|
* <script type="module">
|
54
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
54
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
55
55
|
* console.log(Monster.Types.isPrimitive('2')) // ↦ false
|
56
56
|
* console.log(Monster.Types.isPrimitive([])) // ↦ true
|
57
57
|
* </script>
|
@@ -61,7 +61,7 @@ function isIterable(value) {
|
|
61
61
|
*
|
62
62
|
* ```
|
63
63
|
* <script type="module">
|
64
|
-
* import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
64
|
+
* import {isPrimitive} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
65
65
|
* console.log(isPrimitive('2')) // ↦ true
|
66
66
|
* console.log(isPrimitive([])) // ↦ false
|
67
67
|
* </script>
|
@@ -96,7 +96,7 @@ function isPrimitive(value) {
|
|
96
96
|
*
|
97
97
|
* ```
|
98
98
|
* <script type="module">
|
99
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
99
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
100
100
|
* console.log(Monster.Types.isSymbol('2')) // ↦ false
|
101
101
|
* console.log(Monster.Types.isSymbol(Symbol('test')) // ↦ true
|
102
102
|
* </script>
|
@@ -106,7 +106,7 @@ function isPrimitive(value) {
|
|
106
106
|
*
|
107
107
|
* ```
|
108
108
|
* <script type="module">
|
109
|
-
* import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
109
|
+
* import {isSymbol} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
110
110
|
* console.log(isSymbol(Symbol('a'))) // ↦ true
|
111
111
|
* console.log(isSymbol([]) // ↦ false
|
112
112
|
* </script>
|
@@ -129,7 +129,7 @@ function isSymbol(value) {
|
|
129
129
|
*
|
130
130
|
* ```
|
131
131
|
* <script type="module">
|
132
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
132
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
133
133
|
* console.log(Monster.Types.isBoolean('2')) // ↦ false
|
134
134
|
* console.log(Monster.Types.isBoolean([])) // ↦ false
|
135
135
|
* console.log(Monster.Types.isBoolean(true)) // ↦ true
|
@@ -140,7 +140,7 @@ function isSymbol(value) {
|
|
140
140
|
*
|
141
141
|
* ```
|
142
142
|
* <script type="module">
|
143
|
-
* import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
143
|
+
* import {isBoolean} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
144
144
|
* console.log(isBoolean('2')) // ↦ false
|
145
145
|
* console.log(isBoolean([])) // ↦ false
|
146
146
|
* console.log(isBoolean(2>4)) // ↦ true
|
@@ -169,7 +169,7 @@ function isBoolean(value) {
|
|
169
169
|
*
|
170
170
|
* ```
|
171
171
|
* <script type="module">
|
172
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
172
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
173
173
|
* console.log(Monster.Types.isString('2')) // ↦ true
|
174
174
|
* console.log(Monster.Types.isString([])) // ↦ false
|
175
175
|
* </script>
|
@@ -179,7 +179,7 @@ function isBoolean(value) {
|
|
179
179
|
*
|
180
180
|
* ```
|
181
181
|
* <script type="module">
|
182
|
-
* import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
182
|
+
* import {isString} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
183
183
|
* console.log(isString('2')) // ↦ true
|
184
184
|
* console.log(isString([])) // ↦ false
|
185
185
|
* </script>
|
@@ -205,7 +205,7 @@ function isString(value) {
|
|
205
205
|
*
|
206
206
|
* ```
|
207
207
|
* <script type="module">
|
208
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
208
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
209
209
|
* console.log(Monster.Types.isObject('2')) // ↦ false
|
210
210
|
* console.log(Monster.Types.isObject([])) // ↦ false
|
211
211
|
* console.log(Monster.Types.isObject({})) // ↦ true
|
@@ -216,7 +216,7 @@ function isString(value) {
|
|
216
216
|
*
|
217
217
|
* ```
|
218
218
|
* <script type="module">
|
219
|
-
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
219
|
+
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
220
220
|
* console.log(isObject('2')) // ↦ false
|
221
221
|
* console.log(isObject([])) // ↦ false
|
222
222
|
* </script>
|
@@ -247,7 +247,7 @@ function isObject(value) {
|
|
247
247
|
*
|
248
248
|
* ```
|
249
249
|
* <script type="module">
|
250
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
250
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
251
251
|
* console.log(Monster.Types.isInstance('2')) // ↦ false
|
252
252
|
* console.log(Monster.Types.isInstance([])) // ↦ false
|
253
253
|
* console.log(Monster.Types.isInstance({})) // ↦ true
|
@@ -258,7 +258,7 @@ function isObject(value) {
|
|
258
258
|
*
|
259
259
|
* ```
|
260
260
|
* <script type="module">
|
261
|
-
* import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
261
|
+
* import {isInstance} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
262
262
|
* console.log(isInstance('2')) // ↦ false
|
263
263
|
* console.log(isInstance([])) // ↦ false
|
264
264
|
* </script>
|
@@ -287,7 +287,7 @@ function isInstance(value, instance) {
|
|
287
287
|
*
|
288
288
|
* ```
|
289
289
|
* <script type="module">
|
290
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
290
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
291
291
|
* console.log(Monster.Types.isArray('2')) // ↦ false
|
292
292
|
* console.log(Monster.Types.isArray([])) // ↦ true
|
293
293
|
* </script>
|
@@ -297,7 +297,7 @@ function isInstance(value, instance) {
|
|
297
297
|
*
|
298
298
|
* ```
|
299
299
|
* <script type="module">
|
300
|
-
* import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
300
|
+
* import {isArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
301
301
|
* console.log(isArray('2')) // ↦ false
|
302
302
|
* console.log(isArray([])) // ↦ true
|
303
303
|
* </script>
|
@@ -323,7 +323,7 @@ function isArray(value) {
|
|
323
323
|
*
|
324
324
|
* ```
|
325
325
|
* <script type="module">
|
326
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
326
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
327
327
|
* console.log(Monster.Types.isFunction(()=>{})) // ↦ true
|
328
328
|
* console.log(Monster.Types.isFunction('2')) // ↦ false
|
329
329
|
* console.log(Monster.Types.isFunction([])) // ↦ false
|
@@ -334,7 +334,7 @@ function isArray(value) {
|
|
334
334
|
*
|
335
335
|
* ```
|
336
336
|
* <script type="module">
|
337
|
-
* import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
337
|
+
* import {isFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
338
338
|
* console.log(isFunction(()=>{})) // ↦ true
|
339
339
|
* console.log(isFunction('2')) // ↦ false
|
340
340
|
* console.log(isFunction([])) // ↦ false
|
@@ -366,7 +366,7 @@ function isFunction(value) {
|
|
366
366
|
*
|
367
367
|
* ```
|
368
368
|
* <script type="module">
|
369
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
369
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
370
370
|
* console.log(Monster.Types.isInteger(()=>{})) // ↦ true
|
371
371
|
* console.log(Monster.Types.isInteger('2')) // ↦ false
|
372
372
|
* console.log(Monster.Types.isInteger(2)) // ↦ true
|
@@ -377,7 +377,7 @@ function isFunction(value) {
|
|
377
377
|
*
|
378
378
|
* ```
|
379
379
|
* <script type="module">
|
380
|
-
* import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
380
|
+
* import {isInteger} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
381
381
|
* console.log(isInteger(()=>{})) // ↦ true
|
382
382
|
* console.log(isInteger('2')) // ↦ false
|
383
383
|
* console.log(isInteger(2)) // ↦ true
|
package/source/types/observer.js
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
8
|
-
import {TokenList} from './tokenlist.js';
|
9
|
-
import {isObject} from './is.js';
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
10
8
|
import {Base} from './base.js';
|
9
|
+
import {isObject} from './is.js';
|
10
|
+
import {TokenList} from './tokenlist.js';
|
11
11
|
import {UniqueQueue} from './uniquequeue.js';
|
12
12
|
|
13
13
|
/**
|
@@ -17,7 +17,7 @@ import {UniqueQueue} from './uniquequeue.js';
|
|
17
17
|
*
|
18
18
|
* ```
|
19
19
|
* <script type="module">
|
20
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
20
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/observer.js';
|
21
21
|
* console.log(new Monster.Types.Observer())
|
22
22
|
* </script>
|
23
23
|
* ```
|
@@ -26,7 +26,7 @@ import {UniqueQueue} from './uniquequeue.js';
|
|
26
26
|
*
|
27
27
|
* ```
|
28
28
|
* <script type="module">
|
29
|
-
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
29
|
+
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/observer.js';
|
30
30
|
* console.log(new Observer())
|
31
31
|
* </script>
|
32
32
|
* ```
|
@@ -60,7 +60,7 @@ import {UniqueQueue} from './uniquequeue.js';
|
|
60
60
|
*
|
61
61
|
* @example
|
62
62
|
*
|
63
|
-
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
63
|
+
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/observer.js';
|
64
64
|
*
|
65
65
|
* const observer = new Observer(function(a, b, c) {
|
66
66
|
* console.log(this, a, b, c); // ↦ "a", 2, true
|
@@ -4,7 +4,7 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
8
|
import {Base} from './base.js';
|
9
9
|
import {Observer} from "./observer.js";
|
10
10
|
import {validateInstance} from "./validate.js";
|
@@ -16,7 +16,7 @@ import {validateInstance} from "./validate.js";
|
|
16
16
|
*
|
17
17
|
* ```
|
18
18
|
* <script type="module">
|
19
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
19
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/observerlist.js';
|
20
20
|
* console.log(new Monster.Types.ObserverList())
|
21
21
|
* console.log(new Monster.Types.ObserverList())
|
22
22
|
* </script>
|
@@ -26,7 +26,7 @@ import {validateInstance} from "./validate.js";
|
|
26
26
|
*
|
27
27
|
* ```
|
28
28
|
* <script type="module">
|
29
|
-
* import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
29
|
+
* import {ObserverList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/observerlist.js';
|
30
30
|
* console.log(ObserverList())
|
31
31
|
* console.log(ObserverList())
|
32
32
|
* </script>
|
@@ -3,12 +3,12 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {ObserverList} from "./observerlist.js";
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
|
+
import {Base} from './base.js';
|
8
|
+
import {isArray, isObject, isPrimitive} from "./is.js";
|
10
9
|
import {Observer} from "./observer.js";
|
11
|
-
import {
|
10
|
+
import {ObserverList} from "./observerlist.js";
|
11
|
+
import {validateObject} from "./validate.js";
|
12
12
|
|
13
13
|
/**
|
14
14
|
* An observer manages a callback function
|
@@ -17,7 +17,7 @@ import {isObject, isArray, isPrimitive} from "./is.js";
|
|
17
17
|
*
|
18
18
|
* ```
|
19
19
|
* <script type="module">
|
20
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
20
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/proxyobserver.js';
|
21
21
|
* console.log(new Monster.Types.ProxyObserver())
|
22
22
|
* </script>
|
23
23
|
* ```
|
@@ -26,7 +26,7 @@ import {isObject, isArray, isPrimitive} from "./is.js";
|
|
26
26
|
*
|
27
27
|
* ```
|
28
28
|
* <script type="module">
|
29
|
-
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
29
|
+
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/proxyobserver.js';
|
30
30
|
* console.log(new ProxyObserver())
|
31
31
|
* </script>
|
32
32
|
* ```
|
@@ -37,9 +37,9 @@ import {isObject, isArray, isPrimitive} from "./is.js";
|
|
37
37
|
*
|
38
38
|
* @example
|
39
39
|
*
|
40
|
-
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
41
|
-
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
42
|
-
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
40
|
+
* import {ProxyObserver} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/proxyobserver.js';
|
41
|
+
* import {Observer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/observer.js';
|
42
|
+
* import {isObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/is.js';
|
43
43
|
*
|
44
44
|
* const o = new Observer(function () {
|
45
45
|
* if (isObject(this) && this instanceof ProxyObserver) {
|
@@ -201,19 +201,19 @@ function getHandler() {
|
|
201
201
|
// https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver
|
202
202
|
set: function (target, key, value, receiver) {
|
203
203
|
|
204
|
-
if(proxy.proxyMap.has(value)) {
|
205
|
-
value= proxy.proxyMap.get(value);
|
206
|
-
}
|
207
|
-
|
208
|
-
if(proxy.proxyMap.has(target)) {
|
209
|
-
target= proxy.proxyMap.get(target);
|
204
|
+
if (proxy.proxyMap.has(value)) {
|
205
|
+
value = proxy.proxyMap.get(value);
|
210
206
|
}
|
211
|
-
|
207
|
+
|
208
|
+
if (proxy.proxyMap.has(target)) {
|
209
|
+
target = proxy.proxyMap.get(target);
|
210
|
+
}
|
211
|
+
|
212
212
|
let current = Reflect.get(target, key, receiver);
|
213
|
-
if(proxy.proxyMap.has(current)) {
|
214
|
-
current= proxy.proxyMap.get(current);
|
213
|
+
if (proxy.proxyMap.has(current)) {
|
214
|
+
current = proxy.proxyMap.get(current);
|
215
215
|
}
|
216
|
-
|
216
|
+
|
217
217
|
if (current === value) {
|
218
218
|
return true;
|
219
219
|
}
|
@@ -239,7 +239,7 @@ function getHandler() {
|
|
239
239
|
return result;
|
240
240
|
},
|
241
241
|
|
242
|
-
|
242
|
+
|
243
243
|
// https://262.ecma-international.org/9.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p
|
244
244
|
deleteProperty: function (target, key) {
|
245
245
|
if (key in target) {
|
package/source/types/queue.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
7
|
import {Base} from './base.js';
|
8
8
|
|
9
9
|
/**
|
@@ -11,7 +11,7 @@ import {Base} from './base.js';
|
|
11
11
|
*
|
12
12
|
* ```
|
13
13
|
* <script type="module">
|
14
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
14
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/queue.js';
|
15
15
|
* console.log(new Monster.Types.Queue())
|
16
16
|
* </script>
|
17
17
|
* ```
|
@@ -20,14 +20,14 @@ import {Base} from './base.js';
|
|
20
20
|
*
|
21
21
|
* ```
|
22
22
|
* <script type="module">
|
23
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
23
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/queue.js';
|
24
24
|
* console.log(new Queue())
|
25
25
|
* </script>
|
26
26
|
* ```
|
27
27
|
*
|
28
28
|
* @example
|
29
29
|
*
|
30
|
-
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
30
|
+
* import {Queue} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/queue.js';
|
31
31
|
*
|
32
32
|
* const queue = new Queue;
|
33
33
|
*
|
package/source/types/randomid.js
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
+
import {random} from "../math/random.js";
|
3
4
|
/**
|
4
5
|
* @author schukai GmbH
|
5
6
|
*/
|
6
|
-
import {
|
7
|
-
import {ID} from "./id.js";
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
8
|
import {getGlobal} from "./global.js";
|
9
|
-
import {
|
9
|
+
import {ID} from "./id.js";
|
10
10
|
|
11
11
|
/**
|
12
12
|
* @private
|
@@ -19,7 +19,7 @@ let internalCounter = 0;
|
|
19
19
|
*
|
20
20
|
* ```
|
21
21
|
* <script type="module">
|
22
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
22
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/randomid.js';
|
23
23
|
* console.log(new Monster.Types.RandomID())
|
24
24
|
* </script>
|
25
25
|
* ```
|
@@ -28,7 +28,7 @@ let internalCounter = 0;
|
|
28
28
|
*
|
29
29
|
* ```
|
30
30
|
* <script type="module">
|
31
|
-
* import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {RandomID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/randomid.js';
|
32
32
|
* console.log(new RandomID())
|
33
33
|
* </script>
|
34
34
|
* ```
|
package/source/types/stack.js
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
8
|
import {Base} from './base.js';
|
9
9
|
|
10
10
|
/**
|
@@ -12,7 +12,7 @@ import {Base} from './base.js';
|
|
12
12
|
*
|
13
13
|
* ```
|
14
14
|
* <script type="module">
|
15
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
15
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/stack.js';
|
16
16
|
* console.log(new Monster.Types.Stack())
|
17
17
|
* </script>
|
18
18
|
* ```
|
@@ -21,7 +21,7 @@ import {Base} from './base.js';
|
|
21
21
|
*
|
22
22
|
* ```
|
23
23
|
* <script type="module">
|
24
|
-
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
24
|
+
* import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/stack.js';
|
25
25
|
* console.log(new Stack())
|
26
26
|
* </script>
|
27
27
|
* ```
|
@@ -4,10 +4,10 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
import {
|
10
|
-
import {
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
|
+
import {isIterable, isString} from '../types/is.js';
|
9
|
+
import {validateFunction, validateString} from '../types/validate.js';
|
10
|
+
import {Base} from './base.js';
|
11
11
|
|
12
12
|
/**
|
13
13
|
* A tokenlist allows you to manage tokens (individual character strings such as css classes in an attribute string).
|
@@ -18,7 +18,7 @@ import {validateString, validateFunction} from '../types/validate.js';
|
|
18
18
|
*
|
19
19
|
* ```
|
20
20
|
* <script type="module">
|
21
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
21
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/tokenlist.js';
|
22
22
|
* console.log(new Monster.Types.TokenList("myclass row"))
|
23
23
|
* console.log(new Monster.Types.TokenList("myclass row"))
|
24
24
|
* </script>
|
@@ -28,7 +28,7 @@ import {validateString, validateFunction} from '../types/validate.js';
|
|
28
28
|
*
|
29
29
|
* ```
|
30
30
|
* <script type="module">
|
31
|
-
* import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {TokenList} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/tokenlist.js';
|
32
32
|
* console.log(new TokenList("myclass row"))
|
33
33
|
* console.log(new TokenList("myclass row"))
|
34
34
|
* </script>
|
@@ -232,13 +232,13 @@ class TokenList extends Base {
|
|
232
232
|
|
233
233
|
/**
|
234
234
|
* Removes token from string. If token doesn't exist it's added.
|
235
|
-
*
|
235
|
+
*
|
236
236
|
* ```
|
237
237
|
* new TokenList("abc def ghi").toggle("def xyz").toString(); // ↦ "abc ghi xyz"
|
238
238
|
* new TokenList("abc def ghi").toggle(["abc","xyz"]).toString(); // ↦ "def ghi xyz"
|
239
239
|
* new TokenList().toggle(undefined); // ↦ nothing
|
240
240
|
* ```
|
241
|
-
*
|
241
|
+
*
|
242
242
|
* @param {array|string|iteratable} value
|
243
243
|
* @returns {boolean}
|
244
244
|
* @throws {TypeError} unsupported value
|
package/source/types/typeof.js
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
*/
|
6
6
|
|
7
7
|
|
8
|
-
import {
|
8
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
9
9
|
|
10
10
|
/**
|
11
11
|
* The built-in typeof method is known to have some historical weaknesses. This function tries to provide a better and more accurate result.
|
@@ -14,7 +14,7 @@ import {Monster, assignToNamespace} from '../namespace.js';
|
|
14
14
|
*
|
15
15
|
* ```
|
16
16
|
* <script type="module">
|
17
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
17
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/typeof.js';
|
18
18
|
* console.log(Monster.Types.typeOf())
|
19
19
|
* </script>
|
20
20
|
* ```
|
@@ -23,14 +23,14 @@ import {Monster, assignToNamespace} from '../namespace.js';
|
|
23
23
|
*
|
24
24
|
* ```
|
25
25
|
* <script type="module">
|
26
|
-
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
26
|
+
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/typeof.js';
|
27
27
|
* console.log(typeOf())
|
28
28
|
* </script>
|
29
29
|
* ```
|
30
30
|
*
|
31
31
|
* @example
|
32
32
|
*
|
33
|
-
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
33
|
+
* import {typeOf} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/typeof.js';
|
34
34
|
*
|
35
35
|
* console.log(typeOf(undefined)); // ↦ undefined
|
36
36
|
* console.log(typeOf("")); // ↦ string
|