@schukai/monster 1.14.1 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. package/CHANGELOG +14 -0
  2. package/README.md +5 -5
  3. package/dist/modules/constants.js +2 -2
  4. package/dist/modules/constraints/abstract.js +2 -2
  5. package/dist/modules/constraints/abstractoperator.js +2 -2
  6. package/dist/modules/constraints/andoperator.js +2 -2
  7. package/dist/modules/constraints/invalid.js +2 -2
  8. package/dist/modules/constraints/isarray.js +2 -2
  9. package/dist/modules/constraints/isobject.js +2 -2
  10. package/dist/modules/constraints/namespace.js +1 -1
  11. package/dist/modules/constraints/oroperator.js +2 -2
  12. package/dist/modules/constraints/valid.js +2 -2
  13. package/dist/modules/data/buildmap.js +2 -2
  14. package/dist/modules/data/diff.js +2 -2
  15. package/dist/modules/data/extend.js +2 -2
  16. package/dist/modules/data/namespace.js +1 -1
  17. package/dist/modules/data/pathfinder.js +2 -2
  18. package/dist/modules/data/pipe.js +2 -2
  19. package/dist/modules/data/transformer.js +2 -2
  20. package/dist/modules/dom/assembler.js +2 -2
  21. package/dist/modules/dom/attributes.js +2 -2
  22. package/dist/modules/dom/constants.js +2 -2
  23. package/dist/modules/dom/customcontrol.js +2 -2
  24. package/dist/modules/dom/customelement.js +2 -2
  25. package/dist/modules/dom/events.js +2 -2
  26. package/dist/modules/dom/locale.js +2 -2
  27. package/dist/modules/dom/namespace.js +1 -1
  28. package/dist/modules/dom/template.js +2 -2
  29. package/dist/modules/dom/theme.js +2 -2
  30. package/dist/modules/dom/updater.js +2 -2
  31. package/dist/modules/dom/util.js +2 -2
  32. package/dist/modules/i18n/locale.js +2 -2
  33. package/dist/modules/i18n/namespace.js +1 -1
  34. package/dist/modules/i18n/provider.js +2 -2
  35. package/dist/modules/i18n/providers/fetch.js +2 -2
  36. package/dist/modules/i18n/providers/namespace.js +1 -1
  37. package/dist/modules/i18n/translations.js +2 -2
  38. package/dist/modules/logging/handler/console.js +2 -2
  39. package/dist/modules/logging/handler/namespace.js +1 -1
  40. package/dist/modules/logging/handler.js +2 -2
  41. package/dist/modules/logging/logentry.js +2 -2
  42. package/dist/modules/logging/logger.js +2 -2
  43. package/dist/modules/logging/namespace.js +1 -1
  44. package/dist/modules/math/namespace.js +1 -1
  45. package/dist/modules/math/random.js +2 -2
  46. package/dist/modules/monster.js +1 -1
  47. package/dist/modules/namespace.js +1 -1
  48. package/dist/modules/text/formatter.js +2 -2
  49. package/dist/modules/text/namespace.js +1 -1
  50. package/dist/modules/types/base.js +2 -2
  51. package/dist/modules/types/basewithoptions.js +2 -2
  52. package/dist/modules/types/global.js +2 -2
  53. package/dist/modules/types/id.js +2 -2
  54. package/dist/modules/types/is.js +2 -2
  55. package/dist/modules/types/namespace.js +1 -1
  56. package/dist/modules/types/observer.js +2 -2
  57. package/dist/modules/types/observerlist.js +2 -2
  58. package/dist/modules/types/proxyobserver.js +2 -2
  59. package/dist/modules/types/queue.js +2 -2
  60. package/dist/modules/types/randomid.js +2 -2
  61. package/dist/modules/types/stack.js +2 -2
  62. package/dist/modules/types/tokenlist.js +2 -2
  63. package/dist/modules/types/typeof.js +2 -2
  64. package/dist/modules/types/uniquequeue.js +2 -2
  65. package/dist/modules/types/validate.js +2 -2
  66. package/dist/modules/types/version.js +2 -2
  67. package/dist/modules/util/clone.js +2 -2
  68. package/dist/modules/util/comparator.js +2 -2
  69. package/dist/modules/util/freeze.js +2 -2
  70. package/dist/modules/util/namespace.js +1 -1
  71. package/dist/monster.dev.js +1096 -844
  72. package/dist/monster.dev.js.map +1 -1
  73. package/dist/monster.js +3 -3
  74. package/package.json +1 -1
  75. package/source/constants.js +6 -5
  76. package/source/constraints/abstract.js +2 -2
  77. package/source/constraints/abstractoperator.js +3 -3
  78. package/source/constraints/andoperator.js +7 -7
  79. package/source/constraints/invalid.js +6 -6
  80. package/source/constraints/isarray.js +6 -6
  81. package/source/constraints/isobject.js +6 -6
  82. package/source/constraints/oroperator.js +8 -8
  83. package/source/constraints/valid.js +6 -6
  84. package/source/data/buildmap.js +15 -15
  85. package/source/data/diff.js +6 -6
  86. package/source/data/extend.js +55 -13
  87. package/source/data/pathfinder.js +6 -7
  88. package/source/data/pipe.js +5 -5
  89. package/source/data/transformer.js +5 -6
  90. package/source/dom/assembler.js +5 -5
  91. package/source/dom/attributes.js +26 -26
  92. package/source/dom/constants.js +1 -2
  93. package/source/dom/customcontrol.js +14 -50
  94. package/source/dom/customelement.js +125 -28
  95. package/source/dom/events.js +7 -7
  96. package/source/dom/locale.js +5 -5
  97. package/source/dom/template.js +7 -7
  98. package/source/dom/theme.js +6 -6
  99. package/source/dom/updater.js +35 -13
  100. package/source/dom/util.js +9 -9
  101. package/source/i18n/locale.js +7 -7
  102. package/source/i18n/provider.js +5 -5
  103. package/source/i18n/providers/fetch.js +10 -10
  104. package/source/i18n/translations.js +5 -5
  105. package/source/logging/handler/console.js +4 -4
  106. package/source/logging/handler.js +4 -4
  107. package/source/logging/logentry.js +4 -4
  108. package/source/logging/logger.js +4 -4
  109. package/source/math/random.js +5 -5
  110. package/source/namespace.js +1 -1
  111. package/source/text/formatter.js +4 -5
  112. package/source/types/base.js +4 -5
  113. package/source/types/basewithoptions.js +9 -8
  114. package/source/types/global.js +6 -6
  115. package/source/types/id.js +6 -6
  116. package/source/types/is.js +22 -22
  117. package/source/types/observer.js +5 -5
  118. package/source/types/observerlist.js +4 -4
  119. package/source/types/proxyobserver.js +32 -26
  120. package/source/types/queue.js +13 -7
  121. package/source/types/randomid.js +5 -5
  122. package/source/types/stack.js +11 -4
  123. package/source/types/tokenlist.js +4 -4
  124. package/source/types/typeof.js +5 -5
  125. package/source/types/uniquequeue.js +11 -4
  126. package/source/types/validate.js +22 -22
  127. package/source/types/version.js +9 -9
  128. package/source/util/clone.js +4 -4
  129. package/source/util/comparator.js +6 -6
  130. package/source/util/freeze.js +4 -4
  131. package/test/cases/data/extend.js +66 -13
  132. package/test/cases/dom/customcontrol.js +16 -2
  133. package/test/cases/dom/customelement.js +64 -6
  134. package/test/cases/monster.js +1 -1
  135. package/test/cases/types/proxyobserver.js +9 -0
  136. package/test/web/monster-dev.html +3 -3
  137. package/test/web/monster.html +2 -2
  138. package/test/web/test.html +3 -3
  139. package/test/web/tests.js +3 -3
@@ -3,8 +3,8 @@
3
3
  /**
4
4
  * @author schukai GmbH
5
5
  */
6
-
7
- import {Monster, Base} from "../types/base.js";
6
+ import {Monster, assignToNamespace} from '../namespace.js';
7
+ import {Base} from "../types/base.js";
8
8
  import {validateString} from "../types/validate.js";
9
9
  import {clone} from "../util/clone.js";
10
10
 
@@ -23,7 +23,7 @@ const localeStringSymbol = Symbol('localeString');
23
23
  *
24
24
  * ```
25
25
  * <script type="module">
26
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/locale.js';
26
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/locale.js';
27
27
  * console.log(new Monster.I18n.Locale())
28
28
  * </script>
29
29
  * ```
@@ -32,7 +32,7 @@ const localeStringSymbol = Symbol('localeString');
32
32
  *
33
33
  * ```
34
34
  * <script type="module">
35
- * import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/locale.js';
35
+ * import {Locale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/locale.js';
36
36
  * console.log(new Locale())
37
37
  * </script>
38
38
  * ```
@@ -189,7 +189,7 @@ class Locale extends Base {
189
189
  *
190
190
  * ```
191
191
  * <script type="module">
192
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/locale.js';
192
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/locale.js';
193
193
  * console.log(new Monster.I18n.createLocale())
194
194
  * </script>
195
195
  * ```
@@ -198,7 +198,7 @@ class Locale extends Base {
198
198
  *
199
199
  * ```
200
200
  * <script type="module">
201
- * import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/locale.js';
201
+ * import {createLocale} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/locale.js';
202
202
  * console.log(createLocale())
203
203
  * </script>
204
204
  * ```
@@ -318,5 +318,5 @@ function parseLocale(locale) {
318
318
  }
319
319
 
320
320
 
321
- Monster.assignToNamespace('Monster.I18n', Locale, parseLocale);
321
+ assignToNamespace('Monster.I18n', Locale, parseLocale);
322
322
  export {Monster, Locale, parseLocale}
@@ -3,8 +3,8 @@
3
3
  /**
4
4
  * @author schukai GmbH
5
5
  */
6
-
7
- import {Monster, BaseWithOptions} from "../types/basewithoptions.js";
6
+ import {Monster, assignToNamespace} from '../namespace.js';
7
+ import {BaseWithOptions} from "../types/basewithoptions.js";
8
8
  import {Locale} from "./locale.js"
9
9
  import {Translations} from "./translations.js"
10
10
 
@@ -15,7 +15,7 @@ import {Translations} from "./translations.js"
15
15
  *
16
16
  * ```
17
17
  * <script type="module">
18
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/provider.js';
18
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/provider.js';
19
19
  * console.log(new Monster.I18n.Provider())
20
20
  * </script>
21
21
  * ```
@@ -24,7 +24,7 @@ import {Translations} from "./translations.js"
24
24
  *
25
25
  * ```
26
26
  * <script type="module">
27
- * import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/provider.js';
27
+ * import {Provider} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/provider.js';
28
28
  * console.log(new Provider())
29
29
  * </script>
30
30
  * ```
@@ -54,5 +54,5 @@ class Provider extends BaseWithOptions {
54
54
  }
55
55
 
56
56
 
57
- Monster.assignToNamespace('Monster.I18n', Provider);
57
+ assignToNamespace('Monster.I18n', Provider);
58
58
  export {Monster, Provider}
@@ -3,22 +3,22 @@
3
3
  /**
4
4
  * @author schukai GmbH
5
5
  */
6
-
6
+ import {Monster, assignToNamespace} from '../../namespace.js';
7
7
  import {Formatter} from "../../text/formatter.js";
8
- import {Monster} from "../../types/base.js";
9
8
  import {getGlobalFunction} from "../../types/global.js";
10
- import {validateInstance, validateObject, validateString} from "../../types/validate.js";
11
- import {isString, isObject, isInstance} from "../../types/is.js";
9
+ import { validateObject, validateString} from "../../types/validate.js";
10
+ import {isString, isInstance} from "../../types/is.js";
12
11
  import {parseLocale} from "../locale.js";
13
12
  import {Provider} from "../provider.js";
14
- import {PROPERTY_KEY_OPTIONS} from "../../constants.js";
13
+ import {PROPERTY_KEY_INTERNALDATA} from "../../constants.js";
15
14
  import {Translations} from "../translations.js";
15
+ import {extend} from "../../data/extend.js";
16
16
 
17
17
  /**
18
18
  * @private
19
19
  * @type {symbol}
20
20
  */
21
- const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
21
+ const optionsSymbol = Symbol.for(PROPERTY_KEY_INTERNALDATA);
22
22
 
23
23
  /**
24
24
  * The fetch provider retrieves a JSON file from the given URL and returns a translation object.
@@ -27,7 +27,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
27
27
  *
28
28
  * ```
29
29
  * <script type="module">
30
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/providers/fetch.js';
30
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/providers/fetch.js';
31
31
  * console.log(new Monster.I18n.Providers.Fetch())
32
32
  * </script>
33
33
  * ```
@@ -36,7 +36,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
36
36
  *
37
37
  * ```
38
38
  * <script type="module">
39
- * import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/providers/fetch.js';
39
+ * import {Fetch} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/providers/fetch.js';
40
40
  * console.log(new Fetch())
41
41
  * </script>
42
42
  * ```
@@ -69,7 +69,7 @@ class Fetch extends Provider {
69
69
  validateString(url);
70
70
 
71
71
  this.url = url;
72
- this[optionsSymbol] = Object.assign({}, super.defaults, this.defaults, validateObject(options));
72
+ this[optionsSymbol] = extend({}, super.defaults, this.defaults, validateObject(options));
73
73
 
74
74
  }
75
75
 
@@ -117,5 +117,5 @@ class Fetch extends Provider {
117
117
  }
118
118
 
119
119
 
120
- Monster.assignToNamespace('Monster.I18n.Providers', Fetch);
120
+ assignToNamespace('Monster.I18n.Providers', Fetch);
121
121
  export {Monster, Fetch}
@@ -3,8 +3,8 @@
3
3
  /**
4
4
  * @author schukai GmbH
5
5
  */
6
-
7
- import {Monster, Base} from "../types/base.js";
6
+ import {Monster, assignToNamespace} from '../namespace.js';
7
+ import { Base} from "../types/base.js";
8
8
  import {isObject, isString} from "../types/is.js";
9
9
  import {validateInstance, validateInteger, validateObject, validateString} from "../types/validate.js";
10
10
  import {Locale, parseLocale} from "./locale.js";
@@ -17,7 +17,7 @@ import {Locale, parseLocale} from "./locale.js";
17
17
  *
18
18
  * ```
19
19
  * <script type="module">
20
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/translations.js';
20
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/translations.js';
21
21
  * console.log(new Monster.I18n.Translations())
22
22
  * </script>
23
23
  * ```
@@ -26,7 +26,7 @@ import {Locale, parseLocale} from "./locale.js";
26
26
  *
27
27
  * ```
28
28
  * <script type="module">
29
- * import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/i18n/translations.js';
29
+ * import {Translations} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/i18n/translations.js';
30
30
  * console.log(new Translations())
31
31
  * </script>
32
32
  * ```
@@ -205,5 +205,5 @@ class Translations extends Base {
205
205
  }
206
206
 
207
207
 
208
- Monster.assignToNamespace('Monster.I18n', Translations);
208
+ assignToNamespace('Monster.I18n', Translations);
209
209
  export {Monster, Translations}
@@ -4,7 +4,7 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
- import {Monster} from '../../namespace.js';
7
+ import {Monster, assignToNamespace} from '../namespace.js';
8
8
  import {Base} from '../../types/base.js';
9
9
  import {Handler} from '../../logging/handler.js';
10
10
 
@@ -13,7 +13,7 @@ import {Handler} from '../../logging/handler.js';
13
13
  *
14
14
  * ```
15
15
  * <script type="module">
16
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/handler/console.js';
16
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/handler/console.js';
17
17
  * console.log(new Monster.Logging.Handler.ConsoleHandler())
18
18
  * </script>
19
19
  * ```
@@ -22,7 +22,7 @@ import {Handler} from '../../logging/handler.js';
22
22
  *
23
23
  * ```
24
24
  * <script type="module">
25
- * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/handler/console.js';
25
+ * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/handler/console.js';
26
26
  * console.log(new ConsoleHandler())
27
27
  * </script>
28
28
  * ```
@@ -38,5 +38,5 @@ class ConsoleHandler extends Base {
38
38
  }
39
39
 
40
40
 
41
- Monster.assignToNamespace('Monster.Logging', ConsoleHandler);
41
+ assignToNamespace('Monster.Logging', ConsoleHandler);
42
42
  export {Monster, Handler};
@@ -4,7 +4,7 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
- import {Monster} from '../namespace.js';
7
+ import {Monster, assignToNamespace} from '../namespace.js';
8
8
  import {Base} from '../types/base.js';
9
9
  import {ALL, DEBUG, ERROR, FATAL, INFO, OFF, TRACE, WARN} from "./logger.js";
10
10
  import {LogEntry} from "./logentry.js";
@@ -15,7 +15,7 @@ import {validateInstance, validateInteger} from "../types/validate.js";
15
15
  *
16
16
  * ```
17
17
  * <script type="module">
18
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/handler.js';
18
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/handler.js';
19
19
  * console.log(new Monster.Logging.Handler())
20
20
  * </script>
21
21
  * ```
@@ -24,7 +24,7 @@ import {validateInstance, validateInteger} from "../types/validate.js";
24
24
  *
25
25
  * ```
26
26
  * <script type="module">
27
- * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/handler.js';
27
+ * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/handler.js';
28
28
  * console.log(new Handler())
29
29
  * </script>
30
30
  * ```
@@ -180,5 +180,5 @@ class Handler extends Base {
180
180
  }
181
181
 
182
182
 
183
- Monster.assignToNamespace('Monster.Logging', Handler);
183
+ assignToNamespace('Monster.Logging', Handler);
184
184
  export {Monster, Handler};
@@ -4,7 +4,7 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
- import {Monster} from '../namespace.js';
7
+ import {Monster, assignToNamespace} from '../namespace.js';
8
8
  import {validateInteger} from '../types/validate.js';
9
9
  import {Base} from '../types/base.js';
10
10
 
@@ -14,7 +14,7 @@ import {Base} from '../types/base.js';
14
14
  *
15
15
  * ```
16
16
  * <script type="module">
17
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/logentry.js';
17
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/logentry.js';
18
18
  * console.log(new Monster.Logging.LogEntry())
19
19
  * </script>
20
20
  * ```
@@ -23,7 +23,7 @@ import {Base} from '../types/base.js';
23
23
  *
24
24
  * ```
25
25
  * <script type="module">
26
- * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/logentry.js';
26
+ * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/logentry.js';
27
27
  * console.log(new LogEntry())
28
28
  * </script>
29
29
  * ```
@@ -64,5 +64,5 @@ class LogEntry extends Base {
64
64
 
65
65
  }
66
66
 
67
- Monster.assignToNamespace('Monster.Logging', LogEntry);
67
+ assignToNamespace('Monster.Logging', LogEntry);
68
68
  export {Monster, LogEntry}
@@ -4,7 +4,7 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
- import {Monster} from '../namespace.js';
7
+ import {Monster, assignToNamespace} from '../namespace.js';
8
8
  import {validateInteger, validateObject, validateString} from '../types/validate.js';
9
9
  import {Handler} from '../logging/handler.js';
10
10
  import {LogEntry} from '../logging/logentry.js';
@@ -65,7 +65,7 @@ const OFF = 0;
65
65
  *
66
66
  * ```
67
67
  * <script type="module">
68
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/logger.js';
68
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/logger.js';
69
69
  * console.log(new Monster.Logging.Logger())
70
70
  * </script>
71
71
  * ```
@@ -74,7 +74,7 @@ const OFF = 0;
74
74
  *
75
75
  * ```
76
76
  * <script type="module">
77
- * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/logging/logger.js';
77
+ * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/logging/logger.js';
78
78
  * console.log(new Logger())
79
79
  * </script>
80
80
  * ```
@@ -256,7 +256,7 @@ class Logger extends Base {
256
256
 
257
257
  }
258
258
 
259
- Monster.assignToNamespace('Monster.Logging', Logger);
259
+ assignToNamespace('Monster.Logging', Logger);
260
260
  export {Monster, Logger, ALL, TRACE, DEBUG, INFO, WARN, ERROR, FATAL, OFF};
261
261
 
262
262
 
@@ -4,8 +4,8 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
-
8
- import {Monster, getGlobal} from '../types/global.js';
7
+ import {Monster, assignToNamespace} from '../namespace.js';
8
+ import { getGlobal} from '../types/global.js';
9
9
 
10
10
 
11
11
  /**
@@ -15,7 +15,7 @@ import {Monster, getGlobal} from '../types/global.js';
15
15
  *
16
16
  * ```
17
17
  * <script type="module">
18
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/math/random.js';
18
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/math/random.js';
19
19
  * console.log(Monster.Math.random(1,10)) // ↦ 5
20
20
  * </script>
21
21
  * ```
@@ -24,7 +24,7 @@ import {Monster, getGlobal} from '../types/global.js';
24
24
  *
25
25
  * ```
26
26
  * <script type="module">
27
- * import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/math/random.js';
27
+ * import {random} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/math/random.js';
28
28
  * console.log(random(1,10)) // ↦ 5
29
29
  * </script>
30
30
  * ```
@@ -120,7 +120,7 @@ function create(min, max) {
120
120
 
121
121
  }
122
122
 
123
- Monster.assignToNamespace('Monster.Math', random);
123
+ assignToNamespace('Monster.Math', random);
124
124
  export {Monster, random}
125
125
 
126
126
 
@@ -65,7 +65,7 @@ export const Monster = new Namespace("Monster");
65
65
  *
66
66
  * ```
67
67
  * <script type="module">
68
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/namespace.js';
68
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/namespace.js';
69
69
  * function hello() {
70
70
  * console.log('Hello World!');
71
71
  * }
@@ -3,9 +3,8 @@
3
3
  /**
4
4
  * @author schukai GmbH
5
5
  */
6
-
6
+ import {Monster, assignToNamespace} from '../namespace.js';
7
7
  import {Pipe} from "../data/pipe.js";
8
- import {Monster} from '../namespace.js';
9
8
  import {Base} from "../types/base.js";
10
9
  import {validateObject, validateString} from "../types/validate.js";
11
10
 
@@ -19,7 +18,7 @@ import {validateObject, validateString} from "../types/validate.js";
19
18
  *
20
19
  * ```
21
20
  * <script type="module">
22
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/text/formatter.js';
21
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/text/formatter.js';
23
22
  * console.log(new Monster.Text.Formatter())
24
23
  * </script>
25
24
  * ```
@@ -28,7 +27,7 @@ import {validateObject, validateString} from "../types/validate.js";
28
27
  *
29
28
  * ```
30
29
  * <script type="module">
31
- * import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/text/formatter.js';
30
+ * import {Formatter} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/text/formatter.js';
32
31
  * console.log(new Formatter())
33
32
  * </script>
34
33
  * ```
@@ -147,5 +146,5 @@ function tokenizer(text) {
147
146
  return formatted.join('');
148
147
  }
149
148
 
150
- Monster.assignToNamespace('Monster.Text', Formatter);
149
+ assignToNamespace('Monster.Text', Formatter);
151
150
  export {Monster, Formatter}
@@ -4,8 +4,7 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
- import {Monster} from '../namespace.js';
8
-
7
+ import {Monster, assignToNamespace} from '../namespace.js';
9
8
 
10
9
  /**
11
10
  * This is the base class from which all monster classes are derived.
@@ -14,7 +13,7 @@ import {Monster} from '../namespace.js';
14
13
  *
15
14
  * ```
16
15
  * <script type="module">
17
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/types/base.js';
16
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/types/base.js';
18
17
  * console.log(new Monster.Types.Base())
19
18
  * </script>
20
19
  * ```
@@ -23,7 +22,7 @@ import {Monster} from '../namespace.js';
23
22
  *
24
23
  * ```
25
24
  * <script type="module">
26
- * import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/types/base.js';
25
+ * import {Base} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/types/base.js';
27
26
  * console.log(new Base())
28
27
  * </script>
29
28
  * ```
@@ -47,5 +46,5 @@ class Base extends Object {
47
46
 
48
47
  }
49
48
 
50
- Monster.assignToNamespace('Monster.Types', Base);
49
+ assignToNamespace('Monster.Types', Base);
51
50
  export {Monster, Base}
@@ -3,17 +3,18 @@
3
3
  /**
4
4
  * @author schukai GmbH
5
5
  */
6
-
7
- import {Monster, Pathfinder} from "../data/pathfinder.js";
6
+ import {Monster, assignToNamespace} from '../namespace.js';
7
+ import {Pathfinder} from "../data/pathfinder.js";
8
8
  import {Base} from "./base.js";
9
9
  import {validateObject} from "./validate.js";
10
- import {PROPERTY_KEY_OPTIONS} from "../constants.js";
10
+ import {PROPERTY_KEY_INTERNALDATA} from "../constants.js";
11
+ import {extend} from "../data/extend.js";
11
12
 
12
13
  /**
13
14
  * @private
14
15
  * @type {symbol}
15
16
  */
16
- const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
17
+ const optionsSymbol = Symbol.for(PROPERTY_KEY_INTERNALDATA);
17
18
 
18
19
  /**
19
20
  * This is the base class with options from which some monster classes are derived.
@@ -22,7 +23,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
22
23
  *
23
24
  * ```
24
25
  * <script type="module">
25
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/types/basewithoptions.js';
26
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/types/basewithoptions.js';
26
27
  * console.log(new Monster.Types.BaseWithOptions())
27
28
  * </script>
28
29
  * ```
@@ -31,7 +32,7 @@ const optionsSymbol = Symbol.for(PROPERTY_KEY_OPTIONS);
31
32
  *
32
33
  * ```
33
34
  * <script type="module">
34
- * import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/types/basewithoptions.js';
35
+ * import {BaseWithOptions} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/types/basewithoptions.js';
35
36
  * console.log(new BaseWithOptions())
36
37
  * </script>
37
38
  * ```
@@ -55,7 +56,7 @@ class BaseWithOptions extends Base {
55
56
  options = {};
56
57
  }
57
58
 
58
- this[optionsSymbol] = Object.assign({}, this.defaults, validateObject(options));
59
+ this[optionsSymbol] = extend({}, this.defaults, validateObject(options));
59
60
 
60
61
  }
61
62
 
@@ -92,5 +93,5 @@ class BaseWithOptions extends Base {
92
93
 
93
94
  }
94
95
 
95
- Monster.assignToNamespace('Monster.Types', BaseWithOptions);
96
+ assignToNamespace('Monster.Types', BaseWithOptions);
96
97
  export {Monster, BaseWithOptions}
@@ -4,7 +4,7 @@
4
4
  * @author schukai GmbH
5
5
  */
6
6
 
7
- import {Monster} from '../namespace.js';
7
+ import {Monster, assignToNamespace} from '../namespace.js';
8
8
  import {validateFunction, validateString, validateObject} from "./validate.js";
9
9
 
10
10
  /**
@@ -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.14.1/dist/modules/types/global.js';
81
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/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.14.1/dist/modules/types/global.js';
90
+ * import {getGlobalObject} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/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.14.1/dist/modules/types/global.js';
118
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/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.14.1/dist/modules/types/global.js';
127
+ * import {getGlobalFunction} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/types/global.js';
128
128
  * console.log(getGlobalFunction('parseInt')) // ↦ f parseInt() { }
129
129
  * </script>
130
130
  * ```
@@ -146,5 +146,5 @@ function getGlobalFunction(name) {
146
146
  }
147
147
 
148
148
 
149
- Monster.assignToNamespace('Monster.Types', getGlobal, getGlobalObject, getGlobalFunction);
149
+ assignToNamespace('Monster.Types', getGlobal, getGlobalObject, getGlobalFunction);
150
150
  export {Monster, getGlobal, getGlobalObject, getGlobalFunction}
@@ -2,9 +2,9 @@
2
2
 
3
3
  /**
4
4
  * @author schukai GmbH
5
- */
6
-
7
- import {Monster, Base} from './base.js';
5
+ */
6
+ import {Monster, assignToNamespace} from '../namespace.js';
7
+ import { Base} from './base.js';
8
8
  import {validateString} from "./validate.js";
9
9
 
10
10
  /**
@@ -24,7 +24,7 @@ let internalCounter = new Map;
24
24
  *
25
25
  * ```
26
26
  * <script type="module">
27
- * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.14.1/dist/modules/types/id.js';
27
+ * import {Monster} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/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.14.1/dist/modules/types/id.js';
36
+ * import {ID} from 'https://cdn.jsdelivr.net/npm/@schukai/monster@1.15.0/dist/modules/types/id.js';
37
37
  * console.log(new ID())
38
38
  * </script>
39
39
  * ```
@@ -77,5 +77,5 @@ class ID extends Base {
77
77
 
78
78
  }
79
79
 
80
- Monster.assignToNamespace('Monster.Types', ID);
80
+ assignToNamespace('Monster.Types', ID);
81
81
  export {Monster, ID}