@schukai/monster 1.15.0 → 1.15.2
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/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/package.json
CHANGED
@@ -3,12 +3,12 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
7
|
import {AbstractConstraint} from "./abstract.js";
|
8
8
|
|
9
9
|
/**
|
10
10
|
* Operators allow you to link constraints together. for example, you can check whether a value is an object or an array. each operator has two operands that are linked together.
|
11
|
-
*
|
11
|
+
*
|
12
12
|
* @since 1.3.0
|
13
13
|
* @copyright schukai GmbH
|
14
14
|
* @memberOf Monster/Constraints
|
@@ -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 {AbstractOperator} from "./abstractoperator.js";
|
9
9
|
|
10
10
|
/**
|
@@ -12,7 +12,7 @@ import {AbstractOperator} from "./abstractoperator.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/constraints/andoperator.js';
|
16
16
|
* new Monster.Constraint.AndOperator();
|
17
17
|
* </script>
|
18
18
|
* ```
|
@@ -21,16 +21,16 @@ import {AbstractOperator} from "./abstractoperator.js";
|
|
21
21
|
*
|
22
22
|
* ```
|
23
23
|
* <script type="module">
|
24
|
-
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
24
|
+
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/andoperator.js';
|
25
25
|
* new AndOperator();
|
26
26
|
* </script>
|
27
27
|
* ```
|
28
|
-
*
|
28
|
+
*
|
29
29
|
* @example
|
30
30
|
*
|
31
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
32
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
33
|
-
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/valid.js';
|
32
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/invalid.js';
|
33
|
+
* import {AndOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/andoperator.js';
|
34
34
|
*
|
35
35
|
* new AndOperator(
|
36
36
|
* new Valid(), new Valid()).isValid()
|
@@ -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 {AbstractConstraint} from "./abstract.js";
|
8
8
|
|
9
9
|
/**
|
@@ -13,7 +13,7 @@ import {AbstractConstraint} from "./abstract.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/constraints/invalid.js';
|
17
17
|
* new Monster.Constraint.Invalid();
|
18
18
|
* </script>
|
19
19
|
* ```
|
@@ -22,14 +22,14 @@ import {AbstractConstraint} from "./abstract.js";
|
|
22
22
|
*
|
23
23
|
* ```
|
24
24
|
* <script type="module">
|
25
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
25
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/invalid.js';
|
26
26
|
* new Invalid();
|
27
27
|
* </script>
|
28
28
|
* ```
|
29
29
|
*
|
30
30
|
* @example
|
31
31
|
*
|
32
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
32
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/invalid.js';
|
33
33
|
*
|
34
34
|
* new Invalid().isValid()
|
35
35
|
* .then(()=>console.log(true))
|
@@ -3,16 +3,16 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import { AbstractConstraint} from "./abstract.js";
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
7
|
import {isArray} from "../types/is.js";
|
8
|
+
import {AbstractConstraint} from "./abstract.js";
|
9
9
|
|
10
10
|
/**
|
11
11
|
* You can call the method via the monster namespace `new Monster.Constraint.IsObject()`.
|
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/constraints/isarray.js';
|
16
16
|
* console.log(new Monster.Constraint.IsArray())
|
17
17
|
* </script>
|
18
18
|
* ```
|
@@ -21,14 +21,14 @@ import {isArray} from "../types/is.js";
|
|
21
21
|
*
|
22
22
|
* ```
|
23
23
|
* <script type="module">
|
24
|
-
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
24
|
+
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/isarray.js';
|
25
25
|
* console.log(new IsArray())
|
26
26
|
* </script>
|
27
27
|
* ```
|
28
|
-
*
|
28
|
+
*
|
29
29
|
* @example
|
30
30
|
*
|
31
|
-
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {IsArray} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/isarray.js';
|
32
32
|
*
|
33
33
|
* new IsArray()
|
34
34
|
* .isValid([])
|
@@ -3,16 +3,16 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import {AbstractConstraint} from "./abstract.js";
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
7
|
import {isObject} from "../types/is.js";
|
8
|
+
import {AbstractConstraint} from "./abstract.js";
|
9
9
|
|
10
10
|
/**
|
11
11
|
* You can call the method via the monster namespace `new Monster.Constraint.IsObject()`.
|
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/constraints/isobject.js';
|
16
16
|
* console.log(new Monster.Constraint.IsObject())
|
17
17
|
* </script>
|
18
18
|
* ```
|
@@ -21,14 +21,14 @@ import {isObject} from "../types/is.js";
|
|
21
21
|
*
|
22
22
|
* ```
|
23
23
|
* <script type="module">
|
24
|
-
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
24
|
+
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/isobject.js';
|
25
25
|
* console.log(new IsObject())
|
26
26
|
* </script>
|
27
27
|
* ```
|
28
|
-
*
|
28
|
+
*
|
29
29
|
* @example
|
30
30
|
*
|
31
|
-
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {IsObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/isobject.js';
|
32
32
|
*
|
33
33
|
* new IsObject()
|
34
34
|
* .isValid({})
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
/**
|
4
4
|
* Constraints are used to define conditions that must be met by the value of a variable so that the value can be transferred to the system.
|
5
|
-
*
|
5
|
+
*
|
6
6
|
* @namespace Monster/Constraints
|
7
7
|
* @author schukai GmbH
|
8
8
|
*/
|
@@ -11,4 +11,4 @@
|
|
11
11
|
* @private
|
12
12
|
* @type {string}
|
13
13
|
*/
|
14
|
-
const namespace="Monster.Constraints";
|
14
|
+
const namespace = "Monster.Constraints";
|
@@ -3,15 +3,15 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import {
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
|
+
import {AbstractOperator} from "./abstractoperator.js";
|
8
8
|
|
9
9
|
/**
|
10
10
|
* The OrOperator is used to link several constraints. The constraint is fulfilled if one of the constraints is fulfilled.
|
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/constraint/oroperator.js';
|
15
15
|
* new Monster.Constraint.OrOperator();
|
16
16
|
* </script>
|
17
17
|
* ```
|
@@ -20,16 +20,16 @@ import { AbstractOperator} from "./abstractoperator.js";
|
|
20
20
|
*
|
21
21
|
* ```
|
22
22
|
* <script type="module">
|
23
|
-
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
23
|
+
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraint/oroperator.js';
|
24
24
|
* new OrOperator();
|
25
25
|
* </script>
|
26
26
|
* ```
|
27
27
|
*
|
28
28
|
* @example
|
29
29
|
*
|
30
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
-
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
32
|
-
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
30
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/valid.js';
|
31
|
+
* import {Invalid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/invalid.js';
|
32
|
+
* import {OrOperator} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/oroperator.js';
|
33
33
|
*
|
34
34
|
* new OrOperator(
|
35
35
|
* new Valid(), new Invalid()).isValid()
|
@@ -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 {AbstractConstraint} from "./abstract.js";
|
8
8
|
|
9
9
|
/**
|
10
10
|
* The valid constraint allows an always valid query to be performed. this constraint is mainly intended for testing.
|
@@ -13,7 +13,7 @@ import { AbstractConstraint} from "./abstract.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/constraints/valid.js';
|
17
17
|
* new Monster.Constraint.Valid();
|
18
18
|
* </script>
|
19
19
|
* ```
|
@@ -22,14 +22,14 @@ import { AbstractConstraint} from "./abstract.js";
|
|
22
22
|
*
|
23
23
|
* ```
|
24
24
|
* <script type="module">
|
25
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
25
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/valid.js';
|
26
26
|
* new Valid();
|
27
27
|
* </script>
|
28
28
|
* ```
|
29
|
-
*
|
29
|
+
*
|
30
30
|
* @example
|
31
31
|
*
|
32
|
-
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
32
|
+
* import {Valid} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/constraints/valid.js';
|
33
33
|
*
|
34
34
|
* new Valid().isValid()
|
35
35
|
* .then(()=>console.log(true))
|
package/source/data/buildmap.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 {isFunction} from "../types/is.js";
|
9
9
|
import {validateString} from "../types/validate.js";
|
10
10
|
import {Pathfinder} from "./pathfinder.js";
|
@@ -19,7 +19,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
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/data/buildmap.js';
|
23
23
|
* console.log(Monster.Data.buildMap())
|
24
24
|
* </script>
|
25
25
|
* ```
|
@@ -28,7 +28,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
28
28
|
*
|
29
29
|
* ```
|
30
30
|
* <script type="module">
|
31
|
-
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {buildMap} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/types/buildmap.js';
|
32
32
|
* console.log(buildMap())
|
33
33
|
* </script>
|
34
34
|
* ```
|
package/source/data/diff.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
3
|
/**
|
4
|
-
* @author schukai GmbH
|
4
|
+
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
8
|
-
import {
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
8
|
+
import {isArray, isObject} from "../types/is.js";
|
9
9
|
|
10
10
|
/**
|
11
11
|
* With the diff function you can perform the change of one object to another. The result shows the changes of the second object to the first object.
|
@@ -16,7 +16,7 @@ import { isArray, isObject} from "../types/is.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/data/diff.js';
|
20
20
|
* console.log(Monster.Data.Diff(a, b))
|
21
21
|
* </script>
|
22
22
|
* ```
|
@@ -25,15 +25,15 @@ import { isArray, isObject} from "../types/is.js";
|
|
25
25
|
*
|
26
26
|
* ```
|
27
27
|
* <script type="module">
|
28
|
-
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
28
|
+
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/diff.js';
|
29
29
|
* console.log(Diff(a, b))
|
30
30
|
* </script>
|
31
31
|
* ```
|
32
32
|
*
|
33
33
|
* @example
|
34
|
-
*
|
35
|
-
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
36
|
-
*
|
34
|
+
*
|
35
|
+
* import {Diff} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/diff.js';
|
36
|
+
*
|
37
37
|
* // given are two objects x and y.
|
38
38
|
*
|
39
39
|
* let x = {
|
package/source/data/extend.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 {isArray, isObject} from "../types/is.js";
|
8
8
|
import {typeOf} from "../types/typeof.js";
|
9
9
|
|
10
10
|
/**
|
@@ -15,7 +15,7 @@ import {typeOf} from "../types/typeof.js";
|
|
15
15
|
*
|
16
16
|
* ```
|
17
17
|
* <script type="module">
|
18
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
18
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/extend.js';
|
19
19
|
* console.log(Monster.Data.extend(a, b))
|
20
20
|
* </script>
|
21
21
|
* ```
|
@@ -24,7 +24,7 @@ import {typeOf} from "../types/typeof.js";
|
|
24
24
|
*
|
25
25
|
* ```
|
26
26
|
* <script type="module">
|
27
|
-
* import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
27
|
+
* import {extend} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/extend.js';
|
28
28
|
* console.log(extend(a, b))
|
29
29
|
* </script>
|
30
30
|
* ```
|
@@ -56,8 +56,8 @@ function extend() {
|
|
56
56
|
for (let k in a) {
|
57
57
|
|
58
58
|
let v = a?.[k];
|
59
|
-
|
60
|
-
if(v===o?.[k]) {
|
59
|
+
|
60
|
+
if (v === o?.[k]) {
|
61
61
|
continue;
|
62
62
|
}
|
63
63
|
|
package/source/data/namespace.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
/**
|
4
4
|
* In this namespace you will find classes and methods for handling data.
|
5
|
-
*
|
5
|
+
*
|
6
6
|
* @namespace Monster/Data
|
7
7
|
* @author schukai GmbH
|
8
8
|
*/
|
@@ -12,4 +12,4 @@
|
|
12
12
|
* @private
|
13
13
|
* @type {string}
|
14
14
|
*/
|
15
|
-
const namespace="Monster.Data";
|
15
|
+
const namespace = "Monster.Data";
|
@@ -3,11 +3,11 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import {isObject, isArray, isInteger} from '../types/is.js';
|
8
|
-
import {validateString, validateInteger} from '../types/validate.js';
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
9
7
|
import {Base} from '../types/base.js';
|
8
|
+
import {isArray, isInteger, isObject} from '../types/is.js';
|
10
9
|
import {Stack} from "../types/stack.js";
|
10
|
+
import {validateInteger, validateString} from '../types/validate.js';
|
11
11
|
|
12
12
|
/**
|
13
13
|
* path separator
|
@@ -27,7 +27,7 @@ const WILDCARD = '*';
|
|
27
27
|
*
|
28
28
|
* ```
|
29
29
|
* <script type="module">
|
30
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
30
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pathfinder.js';
|
31
31
|
* console.log(new Monster.Data.Pathfinder())
|
32
32
|
* </script>
|
33
33
|
* ```
|
@@ -36,7 +36,7 @@ const WILDCARD = '*';
|
|
36
36
|
*
|
37
37
|
* ```
|
38
38
|
* <script type="module">
|
39
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
39
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pathfinder.js';
|
40
40
|
* console.log(new Pathfinder())
|
41
41
|
* </script>
|
42
42
|
* ```
|
@@ -78,7 +78,7 @@ const WILDCARD = '*';
|
|
78
78
|
*
|
79
79
|
* @example
|
80
80
|
*
|
81
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
81
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pathfinder.js';
|
82
82
|
*
|
83
83
|
* let value = new Pathfinder({
|
84
84
|
* a: {
|
@@ -104,7 +104,7 @@ const WILDCARD = '*';
|
|
104
104
|
*
|
105
105
|
* @example
|
106
106
|
*
|
107
|
-
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
107
|
+
* import {Pathfinder} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pathfinder.js';
|
108
108
|
*
|
109
109
|
* let p = new Pathfinder({
|
110
110
|
* a: {
|
@@ -398,7 +398,7 @@ function setValueViaPath(object, path, value) {
|
|
398
398
|
assignProperty(anchor, last, value);
|
399
399
|
}
|
400
400
|
|
401
|
-
|
401
|
+
|
402
402
|
|
403
403
|
}
|
404
404
|
|
@@ -411,7 +411,7 @@ function setValueViaPath(object, path, value) {
|
|
411
411
|
function assignProperty(object, key, value) {
|
412
412
|
|
413
413
|
if (!object.hasOwnProperty(key)) {
|
414
|
-
object[key]=value;
|
414
|
+
object[key] = value;
|
415
415
|
return;
|
416
416
|
}
|
417
417
|
|
@@ -419,8 +419,8 @@ function assignProperty(object, key, value) {
|
|
419
419
|
delete object[key];
|
420
420
|
}
|
421
421
|
|
422
|
-
object[key]=value;
|
423
|
-
|
422
|
+
object[key] = value;
|
423
|
+
|
424
424
|
}
|
425
425
|
|
426
426
|
/**
|
@@ -456,6 +456,6 @@ function deleteValueViaPath(object, path) {
|
|
456
456
|
delete anchor[last];
|
457
457
|
}
|
458
458
|
|
459
|
-
|
459
|
+
|
460
460
|
|
461
461
|
}
|
package/source/data/pipe.js
CHANGED
@@ -4,10 +4,10 @@
|
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
6
|
|
7
|
-
import {
|
8
|
-
import {Transformer} from './transformer.js';
|
7
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
9
8
|
import {Base} from '../types/base.js';
|
10
|
-
import {
|
9
|
+
import {validateString} from '../types/validate.js';
|
10
|
+
import {Transformer} from './transformer.js';
|
11
11
|
|
12
12
|
|
13
13
|
const DELIMITER = '|';
|
@@ -18,8 +18,8 @@ const DELIMITER = '|';
|
|
18
18
|
* You can call the method via the monster namespace `new Monster.Data.Pipe()`.
|
19
19
|
*
|
20
20
|
* ```
|
21
|
-
* <script type="module">
|
22
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
21
|
+
* <script type="module">
|
22
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pipe.js';
|
23
23
|
* console.log(new Monster.Data.Pipe())
|
24
24
|
* </script>
|
25
25
|
* ```
|
@@ -28,7 +28,7 @@ const DELIMITER = '|';
|
|
28
28
|
*
|
29
29
|
* ```
|
30
30
|
* <script type="module">
|
31
|
-
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
31
|
+
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pipe.js';
|
32
32
|
* console.log(new Pipe())
|
33
33
|
* </script>
|
34
34
|
* ```
|
@@ -39,7 +39,7 @@ const DELIMITER = '|';
|
|
39
39
|
* the word is then converted to uppercase letters and a prefix Hello is added. the two backslash safe the space char.
|
40
40
|
*
|
41
41
|
* @example
|
42
|
-
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
42
|
+
* import {Pipe} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/pipe.js';
|
43
43
|
*
|
44
44
|
* let obj = {
|
45
45
|
* a: {
|
@@ -3,18 +3,18 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
7
|
import {Base} from '../types/base.js';
|
8
8
|
import {getGlobal} from "../types/global.js";
|
9
|
+
import {ID} from '../types/id.js';
|
10
|
+
import {isArray, isObject, isString} from '../types/is.js';
|
9
11
|
import {
|
10
|
-
validateString,
|
11
|
-
validatePrimitive,
|
12
12
|
validateFunction,
|
13
13
|
validateInteger,
|
14
|
-
validateObject
|
14
|
+
validateObject,
|
15
|
+
validatePrimitive,
|
16
|
+
validateString
|
15
17
|
} from '../types/validate.js';
|
16
|
-
import {isObject, isString, isArray} from '../types/is.js';
|
17
|
-
import {ID} from '../types/id.js';
|
18
18
|
import {clone} from "../util/clone.js";
|
19
19
|
import {Pathfinder} from "./pathfinder.js";
|
20
20
|
|
@@ -25,7 +25,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
25
25
|
*
|
26
26
|
* ```
|
27
27
|
* <script type="module">
|
28
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
28
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/transformer.js';
|
29
29
|
* console.log(new Monster.Data.Transformer())
|
30
30
|
* </script>
|
31
31
|
* ```
|
@@ -34,7 +34,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
34
34
|
*
|
35
35
|
* ```
|
36
36
|
* <script type="module">
|
37
|
-
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
37
|
+
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/transformer.js';
|
38
38
|
* console.log(new Transformer())
|
39
39
|
* </script>
|
40
40
|
* ```
|
@@ -113,7 +113,7 @@ import {Pathfinder} from "./pathfinder.js";
|
|
113
113
|
*
|
114
114
|
* @example
|
115
115
|
*
|
116
|
-
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
116
|
+
* import {Transformer} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/data/transformer.js';
|
117
117
|
*
|
118
118
|
* const transformer = new Transformer("tolower")
|
119
119
|
*
|
package/source/dom/assembler.js
CHANGED
@@ -3,16 +3,16 @@
|
|
3
3
|
/**
|
4
4
|
* @author schukai GmbH
|
5
5
|
*/
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {validateInstance, validateString} from "../types/validate.js";
|
6
|
+
import {assignToNamespace, Monster} from '../namespace.js';
|
7
|
+
import {Base} from '../types/base.js';
|
9
8
|
import {getGlobalFunction} from "../types/global.js";
|
10
9
|
import {ProxyObserver} from "../types/proxyobserver.js";
|
10
|
+
import {validateInstance, validateString} from "../types/validate.js";
|
11
11
|
|
12
12
|
|
13
13
|
/**
|
14
14
|
* attribute prefix
|
15
|
-
*
|
15
|
+
*
|
16
16
|
* @type {string}
|
17
17
|
* @memberOf Monster/DOM
|
18
18
|
*/
|
@@ -23,7 +23,7 @@ const ATTRIBUTEPREFIX = "data-monster-";
|
|
23
23
|
*
|
24
24
|
* ```
|
25
25
|
* <script type="module">
|
26
|
-
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
26
|
+
* import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/dom/assembler.js';
|
27
27
|
* console.log(new Monster.DOM.Assembler())
|
28
28
|
* </script>
|
29
29
|
* ```
|
@@ -32,7 +32,7 @@ const ATTRIBUTEPREFIX = "data-monster-";
|
|
32
32
|
*
|
33
33
|
* ```
|
34
34
|
* <script type="module">
|
35
|
-
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.
|
35
|
+
* import {Assembler} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.2/dist/modules/dom/assembler.js';
|
36
36
|
* console.log(new Assembler())
|
37
37
|
* </script>
|
38
38
|
* ```
|