@schukai/monster 1.12.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (163) hide show
  1. package/CHANGELOG +40 -1
  2. package/README.md +5 -5
  3. package/dist/modules/constants.js +2 -0
  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 -0
  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 -0
  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 -0
  33. package/dist/modules/i18n/namespace.js +2 -0
  34. package/dist/modules/i18n/provider.js +2 -0
  35. package/dist/modules/i18n/providers/fetch.js +2 -0
  36. package/dist/modules/i18n/providers/namespace.js +2 -0
  37. package/dist/modules/i18n/translations.js +2 -0
  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 +2 -2
  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 -0
  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 +8692 -6669
  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 +22 -0
  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/namespace.js +2 -0
  83. package/source/constraints/oroperator.js +8 -8
  84. package/source/constraints/valid.js +6 -6
  85. package/source/data/buildmap.js +15 -15
  86. package/source/data/diff.js +6 -6
  87. package/source/data/extend.js +55 -13
  88. package/source/data/namespace.js +2 -0
  89. package/source/data/pathfinder.js +6 -7
  90. package/source/data/pipe.js +5 -5
  91. package/source/data/transformer.js +6 -6
  92. package/source/dom/assembler.js +5 -5
  93. package/source/dom/attributes.js +89 -45
  94. package/source/dom/constants.js +8 -9
  95. package/source/dom/customcontrol.js +301 -0
  96. package/source/dom/customelement.js +149 -31
  97. package/source/dom/events.js +58 -8
  98. package/source/dom/locale.js +59 -0
  99. package/source/dom/namespace.js +2 -0
  100. package/source/dom/template.js +7 -7
  101. package/source/dom/theme.js +6 -6
  102. package/source/dom/updater.js +38 -11
  103. package/source/dom/util.js +10 -10
  104. package/source/i18n/locale.js +322 -0
  105. package/source/i18n/namespace.js +15 -0
  106. package/source/i18n/provider.js +58 -0
  107. package/source/i18n/providers/fetch.js +121 -0
  108. package/source/i18n/providers/namespace.js +15 -0
  109. package/source/i18n/translations.js +209 -0
  110. package/source/logging/handler/console.js +4 -4
  111. package/source/logging/handler.js +4 -4
  112. package/source/logging/logentry.js +4 -4
  113. package/source/logging/logger.js +4 -4
  114. package/source/logging/namespace.js +2 -0
  115. package/source/math/namespace.js +2 -0
  116. package/source/math/random.js +5 -5
  117. package/source/monster.js +26 -16
  118. package/source/namespace.js +10 -8
  119. package/source/text/formatter.js +4 -5
  120. package/source/text/namespace.js +1 -1
  121. package/source/types/base.js +4 -7
  122. package/source/types/basewithoptions.js +97 -0
  123. package/source/types/global.js +6 -6
  124. package/source/types/id.js +6 -6
  125. package/source/types/is.js +22 -22
  126. package/source/types/namespace.js +3 -1
  127. package/source/types/observer.js +5 -5
  128. package/source/types/observerlist.js +4 -4
  129. package/source/types/proxyobserver.js +32 -26
  130. package/source/types/queue.js +13 -7
  131. package/source/types/randomid.js +5 -5
  132. package/source/types/stack.js +11 -4
  133. package/source/types/tokenlist.js +4 -4
  134. package/source/types/typeof.js +5 -5
  135. package/source/types/uniquequeue.js +11 -4
  136. package/source/types/validate.js +22 -22
  137. package/source/types/version.js +9 -9
  138. package/source/util/clone.js +4 -4
  139. package/source/util/comparator.js +6 -6
  140. package/source/util/freeze.js +4 -4
  141. package/source/util/namespace.js +2 -0
  142. package/test/cases/data/extend.js +66 -13
  143. package/test/cases/dom/attributes.js +56 -1
  144. package/test/cases/dom/customcontrol.js +264 -0
  145. package/test/cases/dom/customelement.js +112 -51
  146. package/test/cases/dom/events.js +32 -14
  147. package/test/cases/dom/locale.js +44 -0
  148. package/test/cases/i18n/locale.js +80 -0
  149. package/test/cases/i18n/provider.js +15 -0
  150. package/test/cases/i18n/providers/fetch.js +65 -0
  151. package/test/cases/i18n/translations.js +57 -0
  152. package/test/cases/monster.js +3 -1
  153. package/test/cases/{util → text}/formatter.js +2 -0
  154. package/test/cases/types/basewithoptions.js +25 -0
  155. package/test/cases/types/proxyobserver.js +9 -0
  156. package/test/cases/{text → util}/clone.js +0 -0
  157. package/test/cases/{text → util}/comparator.js +0 -0
  158. package/test/util/jsdom.js +4 -0
  159. package/test/web/import.js +10 -3
  160. package/test/web/monster-dev.html +3 -3
  161. package/test/web/monster.html +3 -3
  162. package/test/web/test.html +3 -3
  163. package/test/web/tests.js +3 -3
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Pipe}from"../data/pipe.js";import{Monster}from"../namespace.js";import{Base}from"../types/base.js";import{validateObject,validateString}from"../types/validate.js";class Formatter extends Base{constructor(e){super(),this.object=validateObject(e),this.openMarker="${",this.closeMarker="}"}setMarker(e,r){return void 0===r&&(r=e),this.openMarker=validateString(e),this.closeMarker=validateString(r),this}format(e){return tokenizer.call(this,validateString(e))}}function tokenizer(e){var r=this;let t=[];for(;;){var a=e.indexOf(r.openMarker);if(-1===a){t.push(e);break}0<a&&(t.push(e.substring(0,a)),e=e.substring(a));var s=e.substring(r.openMarker.length).indexOf(r.closeMarker)+r.openMarker.length;if(-1===s)throw new Error("syntax error in formatter template");a="path:"+e.substring(r.openMarker.length,s);t.push(validateString(new Pipe(a).run(r.object))),e=e.substring(s+r.closeMarker.length)}return t.join("")}Monster.assignToNamespace("Monster.Text",Formatter);export{Monster,Formatter};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Pipe}from"../data/pipe.js";import{Base}from"../types/base.js";import{validateObject,validateString}from"../types/validate.js";class Formatter extends Base{constructor(e){super(),this.object=validateObject(e),this.openMarker="${",this.closeMarker="}"}setMarker(e,r){return void 0===r&&(r=e),this.openMarker=validateString(e),this.closeMarker=validateString(r),this}format(e){return tokenizer.call(this,validateString(e))}}function tokenizer(e){var r=this;let t=[];for(;;){var a=e.indexOf(r.openMarker);if(-1===a){t.push(e);break}0<a&&(t.push(e.substring(0,a)),e=e.substring(a));var s=e.substring(r.openMarker.length).indexOf(r.closeMarker)+r.openMarker.length;if(-1===s)throw new Error("syntax error in formatter template");a="path:"+e.substring(r.openMarker.length,s);t.push(validateString(new Pipe(a).run(r.object))),e=e.substring(s+r.closeMarker.length)}return t.join("")}assignToNamespace("Monster.Text",Formatter);export{Monster,Formatter};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Text";
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";class Base extends Object{toString(){return JSON.stringify(this)}}Monster.assignToNamespace("Monster.Types",Base);export{Monster,Base};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";class Base extends Object{toString(){return JSON.stringify(this)}}assignToNamespace("Monster.Types",Base);export{Monster,Base};
@@ -0,0 +1,2 @@
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Pathfinder}from"../data/pathfinder.js";import{Base}from"./base.js";import{validateObject}from"./validate.js";import{PROPERTY_KEY_INTERNALDATA}from"../constants.js";import{extend}from"../data/extend.js";const optionsSymbol=Symbol.for(PROPERTY_KEY_INTERNALDATA);class BaseWithOptions extends Base{constructor(t){super(),void 0===t&&(t={}),this[optionsSymbol]=extend({},this.defaults,validateObject(t))}get defaults(){return{}}getOption(t,e){let s;try{s=new Pathfinder(this[optionsSymbol]).getVia(t)}catch(t){}return void 0===s?e:s}}assignToNamespace("Monster.Types",BaseWithOptions);export{Monster,BaseWithOptions};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{validateFunction,validateString,validateObject}from"./validate.js";let globalReference;function getGlobal(){return globalReference}function getGlobalObject(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the object "+e+" is not defined");return validateObject(t),t}function getGlobalFunction(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the function "+e+" is not defined");return validateFunction(t),t}!function(){if("object"!=typeof globalThis)if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function(){return this},configurable:!0}),"object"==typeof __monster__)return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,globalReference=globalThis;try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),Monster.assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);export{Monster,getGlobal,getGlobalObject,getGlobalFunction};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{validateFunction,validateString,validateObject}from"./validate.js";let globalReference;function getGlobal(){return globalReference}function getGlobalObject(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the object "+e+" is not defined");return validateObject(t),t}function getGlobalFunction(e){validateString(e);var t=globalReference?.[e];if(void 0===t)throw new Error("the function "+e+" is not defined");return validateFunction(t),t}!function(){if("object"!=typeof globalThis)if("undefined"==typeof self){if("undefined"==typeof window){if(Object.defineProperty(Object.prototype,"__monster__",{get:function(){return this},configurable:!0}),"object"==typeof __monster__)return __monster__.globalThis=__monster__,delete Object.prototype.__monster__,globalReference=globalThis;try{globalReference=Function("return this")()}catch(e){}throw new Error("unsupported environment.")}globalReference=window}else globalReference=self;else globalReference=globalThis}(),assignToNamespace("Monster.Types",getGlobal,getGlobalObject,getGlobalFunction);export{Monster,getGlobal,getGlobalObject,getGlobalFunction};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster,Base}from"./base.js";import{validateString}from"./validate.js";let internalCounter=new Map;class ID extends Base{constructor(t){super(),void 0===t&&(t="id"),validateString(t),internalCounter.has(t)||internalCounter.set(t,1);var e=internalCounter.get(t);this.id=t+e,internalCounter.set(t,++e)}toString(){return this.id}}Monster.assignToNamespace("Monster.Types",ID);export{Monster,ID};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";import{validateString}from"./validate.js";let internalCounter=new Map;class ID extends Base{constructor(e){super(),void 0===e&&(e="id"),validateString(e),internalCounter.has(e)||internalCounter.set(e,1);var t=internalCounter.get(e);this.id=e+t,internalCounter.set(e,++t)}toString(){return this.id}}assignToNamespace("Monster.Types",ID);export{Monster,ID};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";function isIterable(i){return void 0!==i&&(null!==i&&"function"==typeof i?.[Symbol.iterator])}function isPrimitive(i){return null==i||NaN===i||("string"==(i=typeof i)||"number"==i||"boolean"==i||"symbol"==i)}function isSymbol(i){return"symbol"==typeof i}function isBoolean(i){return!0===i||!1===i}function isString(i){return void 0!==i&&"string"==typeof i}function isObject(i){return!isArray(i)&&(!isPrimitive(i)&&"object"==typeof i)}function isInstance(i,n){return!!isObject(i)&&(!!isFunction(n)&&(!!n.hasOwnProperty("prototype")&&i instanceof n))}function isArray(i){return!!Array.isArray(i)}function isFunction(i){return!isArray(i)&&(!isPrimitive(i)&&"function"==typeof i)}function isInteger(i){return Number.isInteger(i)}Monster.assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol);export{Monster,isPrimitive,isBoolean,isString,isObject,isInstance,isArray,isFunction,isIterable,isInteger,isSymbol};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";function isIterable(i){return void 0!==i&&(null!==i&&"function"==typeof i?.[Symbol.iterator])}function isPrimitive(i){return null==i||NaN===i||("string"==(i=typeof i)||"number"==i||"boolean"==i||"symbol"==i)}function isSymbol(i){return"symbol"==typeof i}function isBoolean(i){return!0===i||!1===i}function isString(i){return void 0!==i&&"string"==typeof i}function isObject(i){return!isArray(i)&&(!isPrimitive(i)&&"object"==typeof i)}function isInstance(i,n){return!!isObject(i)&&(!!isFunction(n)&&(!!n.hasOwnProperty("prototype")&&i instanceof n))}function isArray(i){return!!Array.isArray(i)}function isFunction(i){return!isArray(i)&&(!isPrimitive(i)&&"function"==typeof i)}function isInteger(i){return Number.isInteger(i)}assignToNamespace("Monster.Types",isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInteger,isSymbol);export{Monster,isPrimitive,isBoolean,isString,isObject,isInstance,isArray,isFunction,isIterable,isInteger,isSymbol};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Types";
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{TokenList}from"./tokenlist.js";import{isObject}from"./is.js";import{Base}from"./base.js";import{UniqueQueue}from"./uniquequeue.js";class Observer extends Base{constructor(e,...t){if(super(),"function"!=typeof e)throw new Error("observer callback must be a function");this.callback=e,this.arguments=t,this.tags=new TokenList,this.queue=new UniqueQueue}addTag(e){return this.tags.add(e),this}removeTag(e){return this.tags.remove(e),this}getTags(){return this.tags.entries()}hasTag(e){return this.tags.contains(e)}update(e){let i=this;return new Promise(function(s,r){isObject(e)?(i.queue.add(e),setTimeout(()=>{try{if(i.queue.isEmpty())return void s();var t=i.queue.poll();let e=i.callback.apply(t,i.arguments);if(isObject(e)&&e instanceof Promise)return void e.then(s).catch(r);s(e)}catch(e){r(e)}},0)):r("subject must be an object")})}}Monster.assignToNamespace("Monster.Types",Observer);export{Monster,Observer};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{TokenList}from"./tokenlist.js";import{isObject}from"./is.js";import{Base}from"./base.js";import{UniqueQueue}from"./uniquequeue.js";class Observer extends Base{constructor(e,...t){if(super(),"function"!=typeof e)throw new Error("observer callback must be a function");this.callback=e,this.arguments=t,this.tags=new TokenList,this.queue=new UniqueQueue}addTag(e){return this.tags.add(e),this}removeTag(e){return this.tags.remove(e),this}getTags(){return this.tags.entries()}hasTag(e){return this.tags.contains(e)}update(e){let i=this;return new Promise(function(s,r){isObject(e)?(i.queue.add(e),setTimeout(()=>{try{if(i.queue.isEmpty())return void s();var t=i.queue.poll();let e=i.callback.apply(t,i.arguments);if(isObject(e)&&e instanceof Promise)return void e.then(s).catch(r);s(e)}catch(e){r(e)}},0)):r("subject must be an object")})}}assignToNamespace("Monster.Types",Observer);export{Monster,Observer};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{Base}from"./base.js";import{Observer}from"./observer.js";import{validateInstance}from"./validate.js";class ObserverList extends Base{constructor(){super(),this.observers=[]}attach(e){return validateInstance(e,Observer),this.observers.push(e),this}detach(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)this.observers[s]===e&&this.observers.splice(s,1);return this}contains(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)if(this.observers[s]===e)return!0;return!1}notify(e){let s=[];for(var r=0,t=this.observers.length;r<t;r++)s.push(this.observers[r].update(e));return Promise.all(s)}}Monster.assignToNamespace("Monster.Types",ObserverList);export{Monster,ObserverList};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";import{Observer}from"./observer.js";import{validateInstance}from"./validate.js";class ObserverList extends Base{constructor(){super(),this.observers=[]}attach(e){return validateInstance(e,Observer),this.observers.push(e),this}detach(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)this.observers[s]===e&&this.observers.splice(s,1);return this}contains(e){validateInstance(e,Observer);for(var s=0,r=this.observers.length;s<r;s++)if(this.observers[s]===e)return!0;return!1}notify(e){let s=[];for(var r=0,t=this.observers.length;r<t;r++)s.push(this.observers[r].update(e));return Promise.all(s)}}assignToNamespace("Monster.Types",ObserverList);export{Monster,ObserverList};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster,Base}from"./base.js";import{validateObject}from"./validate.js";import{ObserverList}from"./observerlist.js";import{Observer}from"./observer.js";import{isObject,isArray,isPrimitive}from"./is.js";class ProxyObserver extends Base{constructor(e){super(),validateObject(e),this.realSubject=e,this.subject=new Proxy(e,getHandler.call(this)),this.objectMap=new WeakMap,this.objectMap.set(this.realSubject,this.subject),this.observers=new ObserverList}getSubject(){return this.subject}getRealSubject(){return this.realSubject}attachObserver(e){return this.observers.attach(e),this}detachObserver(e){return this.observers.detach(e),this}notifyObservers(){return this.observers.notify(this)}containsObserver(e){return this.observers.contains(e)}}function getHandler(){const i=this,s={get:function(e,t,r){r=Reflect.get(e,t,r);if("symbol"==typeof t)return r;if(isPrimitive(r))return r;if(isArray(r)||isObject(r)){if(i.objectMap.has(r))return i.objectMap.get(r);t=new Proxy(r,s);return i.objectMap.set(r,t),t}return r},set:function(e,t,r,s){if(Reflect.get(e,t,s)===r)return!0;let o=Reflect.getOwnPropertyDescriptor(e,t);return void 0===o&&(o={writable:!0,enumerable:!0,configurable:!0}),o.value=r,e=Reflect.defineProperty(e,t,o),"symbol"!=typeof t&&i.observers.notify(i),e},deleteProperty:function(e,t){return t in e&&(delete e[t],"symbol"!=typeof t&&i.observers.notify(i),!0)},defineProperty:function(e,t,r){r=Reflect.defineProperty(e,t,r);return"symbol"!=typeof t&&i.observers.notify(i),r},setPrototypeOf:function(e,t){var r=Reflect.setPrototypeOf(object1,t);return"symbol"!=typeof t&&i.observers.notify(i),r}};return s}Monster.assignToNamespace("Monster.Types",ProxyObserver);export{Monster,ProxyObserver};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";import{validateObject}from"./validate.js";import{ObserverList}from"./observerlist.js";import{Observer}from"./observer.js";import{isObject,isArray,isPrimitive}from"./is.js";class ProxyObserver extends Base{constructor(e){super(),this.realSubject=validateObject(e),this.subject=new Proxy(e,getHandler.call(this)),this.objectMap=new WeakMap,this.objectMap.set(this.realSubject,this.subject),this.proxyMap=new WeakMap,this.proxyMap.set(this.subject,this.realSubject),this.observers=new ObserverList}getSubject(){return this.subject}getRealSubject(){return this.realSubject}attachObserver(e){return this.observers.attach(e),this}detachObserver(e){return this.observers.detach(e),this}notifyObservers(){return this.observers.notify(this)}containsObserver(e){return this.observers.contains(e)}}function getHandler(){const a=this,s={get:function(e,t,r){r=Reflect.get(e,t,r);if("symbol"==typeof t)return r;if(isPrimitive(r))return r;if(isArray(r)||isObject(r)){if(a.objectMap.has(r))return a.objectMap.get(r);if(a.proxyMap.has(r))return r;t=new Proxy(r,s);return a.objectMap.set(r,t),a.proxyMap.set(t,r),t}return r},set:function(e,t,r,s){a.proxyMap.has(r)&&(r=a.proxyMap.get(r)),a.proxyMap.has(e)&&(e=a.proxyMap.get(e));let o=Reflect.get(e,t,s);if(a.proxyMap.has(o)&&(o=a.proxyMap.get(o)),o===r)return!0;let i=Reflect.getOwnPropertyDescriptor(e,t);return void 0===i&&(i={writable:!0,enumerable:!0,configurable:!0}),i.value=r,e=Reflect.defineProperty(e,t,i),"symbol"!=typeof t&&a.observers.notify(a),e},deleteProperty:function(e,t){return t in e&&(delete e[t],"symbol"!=typeof t&&a.observers.notify(a),!0)},defineProperty:function(e,t,r){r=Reflect.defineProperty(e,t,r);return"symbol"!=typeof t&&a.observers.notify(a),r},setPrototypeOf:function(e,t){var r=Reflect.setPrototypeOf(object1,t);return"symbol"!=typeof t&&a.observers.notify(a),r}};return s}assignToNamespace("Monster.Types",ProxyObserver);export{Monster,ProxyObserver};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- import{Monster,Base}from"./base.js";class Queue extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data[0]}add(t){return this.data.push(t),this}clear(){return this.data=[],this}poll(){if(!this.isEmpty())return this.data.shift()}}Monster.assignToNamespace("Monster.Types",Queue);export{Monster,Queue};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";class Queue extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data[0]}add(s){return this.data.push(s),this}clear(){return this.data=[],this}poll(){if(!this.isEmpty())return this.data.shift()}}assignToNamespace("Monster.Types",Queue);export{Monster,Queue};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster,ID}from"./id.js";import{getGlobal}from"./global.js";import{random}from"../math/random.js";let internalCounter=0;class RandomID extends ID{constructor(){super(),internalCounter+=1,this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+internalCounter}}Monster.assignToNamespace("Monster.Types",RandomID);export{Monster,RandomID};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{ID}from"./id.js";import{getGlobal}from"./global.js";import{random}from"../math/random.js";let internalCounter=0;class RandomID extends ID{constructor(){super(),internalCounter+=1,this.id=getGlobal().btoa(random(1,1e4)).replace(/=/g,"").replace(/^[0-9]+/,"X")+internalCounter}}assignToNamespace("Monster.Types",RandomID);export{Monster,RandomID};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- import{Monster,Base}from"./base.js";class Stack extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data?.[this.data.length-1]}push(t){return this.data.push(t),this}clear(){return this.data=[],this}pop(){if(!this.isEmpty())return this.data.pop()}}Monster.assignToNamespace("Monster.Types",Stack);export{Monster,Stack};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";class Stack extends Base{constructor(){super(),this.data=[]}isEmpty(){return 0===this.data.length}peek(){if(!this.isEmpty())return this.data?.[this.data.length-1]}push(t){return this.data.push(t),this}clear(){return this.data=[],this}pop(){if(!this.isEmpty())return this.data.pop()}}assignToNamespace("Monster.Types",Stack);export{Monster,Stack};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{Base}from"./base.js";import{isString,isIterable}from"../types/is.js";import{validateString,validateFunction}from"../types/validate.js";class TokenList extends Base{constructor(t){super(),this.tokens=new Set,void 0!==t&&this.add(t)}getIterator(){return this[Symbol.iterator]()}[Symbol.iterator](){let t=0,e=this.entries();return{next:()=>t<e.length?{value:e?.[t++],done:!1}:{done:!0}}}contains(r){if(isString(r)){r=r.trim();let e=0;return r.split(" ").forEach(t=>!1!==this.tokens.has(t.trim())&&void e++),0<e}if(isIterable(r)){let t=0;for(var e of r){if(validateString(e),!1===this.tokens.has(e.trim()))return!1;t++}return 0<t}return!1}add(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.add(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.add(e.trim());else if(void 0!==t)throw new TypeError("unsupported value");return this}clear(){return this.tokens.clear(),this}remove(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.delete(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.delete(e.trim());else if(void 0!==t)throw new TypeError("unsupported value");return this}replace(t,e){if(validateString(t),validateString(e),!this.contains(t))return this;let r=Array.from(this.tokens);t=r.indexOf(t);return-1===t||(r.splice(t,1,e),this.tokens=new Set,this.add(r)),this}toggle(t){if(isString(t))t.split(" ").forEach(t=>{toggleValue.call(this,t)});else if(isIterable(t))for(var e of t)toggleValue.call(this,e);else if(void 0!==t)throw new TypeError("unsupported value");return this}entries(){return Array.from(this.tokens)}forEach(t){return validateFunction(t),this.tokens.forEach(t),this}toString(){return this.entries().join(" ")}}function toggleValue(t){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(t),t=t.trim(),this.contains(t)?this.remove(t):this.add(t),this}Monster.assignToNamespace("Monster.Types",TokenList);export{Monster,TokenList};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";import{isString,isIterable}from"../types/is.js";import{validateString,validateFunction}from"../types/validate.js";class TokenList extends Base{constructor(t){super(),this.tokens=new Set,void 0!==t&&this.add(t)}getIterator(){return this[Symbol.iterator]()}[Symbol.iterator](){let t=0,e=this.entries();return{next:()=>t<e.length?{value:e?.[t++],done:!1}:{done:!0}}}contains(r){if(isString(r)){r=r.trim();let e=0;return r.split(" ").forEach(t=>!1!==this.tokens.has(t.trim())&&void e++),0<e}if(isIterable(r)){let t=0;for(var e of r){if(validateString(e),!1===this.tokens.has(e.trim()))return!1;t++}return 0<t}return!1}add(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.add(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.add(e.trim());else if(void 0!==t)throw new TypeError("unsupported value");return this}clear(){return this.tokens.clear(),this}remove(t){if(isString(t))t.split(" ").forEach(t=>{this.tokens.delete(t.trim())});else if(isIterable(t))for(var e of t)validateString(e),this.tokens.delete(e.trim());else if(void 0!==t)throw new TypeError("unsupported value");return this}replace(t,e){if(validateString(t),validateString(e),!this.contains(t))return this;let r=Array.from(this.tokens);t=r.indexOf(t);return-1===t||(r.splice(t,1,e),this.tokens=new Set,this.add(r)),this}toggle(t){if(isString(t))t.split(" ").forEach(t=>{toggleValue.call(this,t)});else if(isIterable(t))for(var e of t)toggleValue.call(this,e);else if(void 0!==t)throw new TypeError("unsupported value");return this}entries(){return Array.from(this.tokens)}forEach(t){return validateFunction(t),this.tokens.forEach(t),this}toString(){return this.entries().join(" ")}}function toggleValue(t){if(!(this instanceof TokenList))throw Error("must be called with TokenList.call");return validateString(t),t=t.trim(),this.contains(t)?this.remove(t):this.add(t),this}assignToNamespace("Monster.Types",TokenList);export{Monster,TokenList};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";function typeOf(t){let e={}.toString.call(t).match(/\s([a-zA-Z]+)/)[1];return"Object"===e&&(t=/^(class|function)\s+(\w+)/.exec(t.constructor.toString()),e=t&&2<t.length?t[2]:""),e.toLowerCase()}Monster.assignToNamespace("Monster.Types",typeOf);export{Monster,typeOf};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";function typeOf(t){let e={}.toString.call(t).match(/\s([a-zA-Z]+)/)[1];return"Object"===e&&(t=/^(class|function)\s+(\w+)/.exec(t.constructor.toString()),e=t&&2<t.length?t[2]:""),e.toLowerCase()}assignToNamespace("Monster.Types",typeOf);export{Monster,typeOf};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- import{Monster,Queue}from"./queue.js";import{validateObject}from"./validate.js";class UniqueQueue extends Queue{constructor(){super(),this.unique=new WeakSet}add(e){return validateObject(e),this.unique.has(e)||(this.unique.add(e),super.add(e)),this}clear(){return super.clear(),this.unique=new WeakSet,this}poll(){if(!this.isEmpty()){var e=this.data.shift();return this.unique.delete(e),e}}}Monster.assignToNamespace("Monster.Types",UniqueQueue);export{Monster,UniqueQueue};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Queue}from"./queue.js";import{validateObject}from"./validate.js";class UniqueQueue extends Queue{constructor(){super(),this.unique=new WeakSet}add(e){return validateObject(e),this.unique.has(e)||(this.unique.add(e),super.add(e)),this}clear(){return super.clear(),this.unique=new WeakSet,this}poll(){if(!this.isEmpty()){var e=this.data.shift();return this.unique.delete(e),e}}}assignToNamespace("Monster.Types",UniqueQueue);export{Monster,UniqueQueue};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInstance,isInteger,isSymbol}from"./is.js";function validateIterable(e){if(!isIterable(e))throw new TypeError("value is not iterable");return e}function validatePrimitive(e){if(!isPrimitive(e))throw new TypeError("value is not a primitive");return e}function validateBoolean(e){if(!isBoolean(e))throw new TypeError("value is not a boolean");return e}function validateString(e){if(!isString(e))throw new TypeError("value is not a string");return e}function validateObject(e){if(!isObject(e))throw new TypeError("value is not a object");return e}function validateInstance(e,t){if(isInstance(e,t))return e;{let e="";throw(isObject(t)||isFunction(t))&&(e=t?.name),e=e&&" "+e,new TypeError("value is not an instance of"+e)}}function validateArray(e){if(!isArray(e))throw new TypeError("value is not an array");return e}function validateSymbol(e){if(!isSymbol(e))throw new TypeError("value is not an symbol");return e}function validateFunction(e){if(!isFunction(e))throw new TypeError("value is not a function");return e}function validateInteger(e){if(!isInteger(e))throw new TypeError("value is not an integer");return e}Monster.assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,validateIterable,validateInteger);export{Monster,validatePrimitive,validateBoolean,validateString,validateObject,validateInstance,validateArray,validateFunction,validateIterable,validateInteger,validateSymbol};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{isPrimitive,isBoolean,isString,isObject,isArray,isFunction,isIterable,isInstance,isInteger,isSymbol}from"./is.js";function validateIterable(e){if(!isIterable(e))throw new TypeError("value is not iterable");return e}function validatePrimitive(e){if(!isPrimitive(e))throw new TypeError("value is not a primitive");return e}function validateBoolean(e){if(!isBoolean(e))throw new TypeError("value is not a boolean");return e}function validateString(e){if(!isString(e))throw new TypeError("value is not a string");return e}function validateObject(e){if(!isObject(e))throw new TypeError("value is not a object");return e}function validateInstance(e,i){if(isInstance(e,i))return e;{let e="";throw(isObject(i)||isFunction(i))&&(e=i?.name),e=e&&" "+e,new TypeError("value is not an instance of"+e)}}function validateArray(e){if(!isArray(e))throw new TypeError("value is not an array");return e}function validateSymbol(e){if(!isSymbol(e))throw new TypeError("value is not an symbol");return e}function validateFunction(e){if(!isFunction(e))throw new TypeError("value is not a function");return e}function validateInteger(e){if(!isInteger(e))throw new TypeError("value is not an integer");return e}assignToNamespace("Monster.Types",validatePrimitive,validateBoolean,validateString,validateObject,validateArray,validateFunction,validateIterable,validateInteger);export{Monster,validatePrimitive,validateBoolean,validateString,validateObject,validateInstance,validateArray,validateFunction,validateIterable,validateInteger,validateSymbol};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{Base}from"./base.js";class Version extends Base{constructor(r,t,e){var s;if(super(),"string"==typeof r&&void 0===t&&void 0===e&&(s=r.toString().split("."),r=parseInt(s[0]||0),t=parseInt(s[1]||0),e=parseInt(s[2]||0)),void 0===r)throw new Error("major version is undefined");if(void 0===t&&(t=0),void 0===e&&(e=0),this.major=parseInt(r),this.minor=parseInt(t),this.patch=parseInt(e),isNaN(this.major))throw new Error("major is not a number");if(isNaN(this.minor))throw new Error("minor is not a number");if(isNaN(this.patch))throw new Error("patch is not a number")}toString(){return this.major+"."+this.minor+"."+this.patch}compareTo(r){if("string"!=typeof(r=r instanceof Version?r.toString():r))throw new Error("type exception");if(r===this.toString())return 0;var t=[this.major,this.minor,this.patch],e=r.split("."),s=Math.max(t.length,e.length);for(let r=0;r<s;r+=1){if(t[r]&&!e[r]&&0<parseInt(t[r])||parseInt(t[r])>parseInt(e[r]))return 1;if(e[r]&&!t[r]&&0<parseInt(e[r])||parseInt(t[r])<parseInt(e[r]))return-1}return 0}}Monster.assignToNamespace("Monster.Types",Version);let monsterVersion;function getVersion(){return monsterVersion instanceof Version||(monsterVersion=new Version("1.12.0")),monsterVersion}Monster.assignToNamespace("Monster",getVersion);export{Monster,Version,getVersion};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"./base.js";class Version extends Base{constructor(r,t,e){var s;if(super(),"string"==typeof r&&void 0===t&&void 0===e&&(s=r.toString().split("."),r=parseInt(s[0]||0),t=parseInt(s[1]||0),e=parseInt(s[2]||0)),void 0===r)throw new Error("major version is undefined");if(void 0===t&&(t=0),void 0===e&&(e=0),this.major=parseInt(r),this.minor=parseInt(t),this.patch=parseInt(e),isNaN(this.major))throw new Error("major is not a number");if(isNaN(this.minor))throw new Error("minor is not a number");if(isNaN(this.patch))throw new Error("patch is not a number")}toString(){return this.major+"."+this.minor+"."+this.patch}compareTo(r){if("string"!=typeof(r=r instanceof Version?r.toString():r))throw new Error("type exception");if(r===this.toString())return 0;var t=[this.major,this.minor,this.patch],e=r.split("."),s=Math.max(t.length,e.length);for(let r=0;r<s;r+=1){if(t[r]&&!e[r]&&0<parseInt(t[r])||parseInt(t[r])>parseInt(e[r]))return 1;if(e[r]&&!t[r]&&0<parseInt(e[r])||parseInt(t[r])<parseInt(e[r]))return-1}return 0}}assignToNamespace("Monster.Types",Version);let monsterVersion;function getVersion(){return monsterVersion instanceof Version||(monsterVersion=new Version("1.15.0")),monsterVersion}assignToNamespace("Monster",getVersion);export{Monster,Version,getVersion};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{isObject,isFunction,isPrimitive,isArray}from"../types/is.js";import{getGlobal}from"../types/global.js";function clone(n){if(null===n)return n;if(isPrimitive(n))return n;if(isFunction(n))return n;if(isArray(n)){let e=[];for(var t=0,r=n.length;t<r;t++)e[t]=clone(n[t]);return e}if(isObject(n)){if(n instanceof Date){let e=new Date;return e.setTime(n.getTime()),e}if("undefined"!=typeof Element&&n instanceof Element)return n;if("undefined"!=typeof HTMLDocument&&n instanceof HTMLDocument)return n;if("undefined"!=typeof DocumentFragment&&n instanceof DocumentFragment)return n;if(n===getGlobal())return n;if("undefined"!=typeof globalContext&&n===globalContext)return n;if("undefined"!=typeof window&&n===window)return n;if("undefined"!=typeof document&&n===document)return n;if("undefined"!=typeof navigator&&n===navigator)return n;if("undefined"!=typeof JSON&&n===JSON)return n;try{if(n instanceof Proxy)return n}catch(e){}return cloneObject(n)}throw new Error("unable to clone obj! its type isn't supported.")}function cloneObject(e){var n,t;if(e.hasOwnProperty("getClone"),"function"===e.getClone)return e.getClone();for(t in n={},"function"==typeof e.constructor&&"function"==typeof e.constructor.call&&(n=new e.constructor),e)e.hasOwnProperty(t)&&(Monster.Types.isPrimitive(e[t])?n[t]=e[t]:n[t]=clone(e[t]));return n}Monster.assignToNamespace("Monster.Util",clone);export{Monster,clone};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{isObject,isFunction,isPrimitive,isArray}from"../types/is.js";import{getGlobal}from"../types/global.js";function clone(n){if(null===n)return n;if(isPrimitive(n))return n;if(isFunction(n))return n;if(isArray(n)){let e=[];for(var t=0,r=n.length;t<r;t++)e[t]=clone(n[t]);return e}if(isObject(n)){if(n instanceof Date){let e=new Date;return e.setTime(n.getTime()),e}if("undefined"!=typeof Element&&n instanceof Element)return n;if("undefined"!=typeof HTMLDocument&&n instanceof HTMLDocument)return n;if("undefined"!=typeof DocumentFragment&&n instanceof DocumentFragment)return n;if(n===getGlobal())return n;if("undefined"!=typeof globalContext&&n===globalContext)return n;if("undefined"!=typeof window&&n===window)return n;if("undefined"!=typeof document&&n===document)return n;if("undefined"!=typeof navigator&&n===navigator)return n;if("undefined"!=typeof JSON&&n===JSON)return n;try{if(n instanceof Proxy)return n}catch(e){}return cloneObject(n)}throw new Error("unable to clone obj! its type isn't supported.")}function cloneObject(e){var n,t;if(e.hasOwnProperty("getClone"),"function"===e.getClone)return e.getClone();for(t in n={},"function"==typeof e.constructor&&"function"==typeof e.constructor.call&&(n=new e.constructor),e)e.hasOwnProperty(t)&&(Monster.Types.isPrimitive(e[t])?n[t]=e[t]:n[t]=clone(e[t]));return n}assignToNamespace("Monster.Util",clone);export{Monster,clone};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster,Base}from"../types/base.js";import{isFunction}from"../types/is.js";class Comparator extends Base{constructor(r){if(super(),isFunction(r))this.compare=r;else{if(void 0!==r)throw new TypeError("unsupported type");this.compare=function(r,e){if(typeof r!=typeof e)throw new TypeError("impractical comparison");return r===e?0:r<e?-1:1}}}reverse(){const t=this.compare;return this.compare=(r,e)=>t(e,r),this}equal(r,e){return 0===this.compare(r,e)}greaterThan(r,e){return 0<this.compare(r,e)}greaterThanOrEqual(r,e){return this.greaterThan(r,e)||this.equal(r,e)}lessThanOrEqual(r,e){return this.lessThan(r,e)||this.equal(r,e)}lessThan(r,e){return this.compare(r,e)<0}}Monster.assignToNamespace("Monster.Util",Comparator);export{Monster,Comparator};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{Base}from"../types/base.js";import{isFunction}from"../types/is.js";class Comparator extends Base{constructor(r){if(super(),isFunction(r))this.compare=r;else{if(void 0!==r)throw new TypeError("unsupported type");this.compare=function(r,e){if(typeof r!=typeof e)throw new TypeError("impractical comparison");return r===e?0:r<e?-1:1}}}reverse(){const s=this.compare;return this.compare=(r,e)=>s(e,r),this}equal(r,e){return 0===this.compare(r,e)}greaterThan(r,e){return 0<this.compare(r,e)}greaterThanOrEqual(r,e){return this.greaterThan(r,e)||this.equal(r,e)}lessThanOrEqual(r,e){return this.lessThan(r,e)||this.equal(r,e)}lessThan(r,e){return this.compare(r,e)<0}}assignToNamespace("Monster.Util",Comparator);export{Monster,Comparator};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
- "use strict";import{Monster}from"../namespace.js";import{validateObject}from"../types/validate.js";function deepFreeze(e){var t;validateObject(e);for(t of Object.getOwnPropertyNames(e)){var r=e[t];e[t]=r&&"object"==typeof r?deepFreeze(r):r}return Object.freeze(e)}Monster.assignToNamespace("Monster.Util",deepFreeze);export{Monster,deepFreeze};
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
+ "use strict";import{Monster,assignToNamespace}from"../namespace.js";import{validateObject}from"../types/validate.js";function deepFreeze(e){var t;validateObject(e);for(t of Object.getOwnPropertyNames(e)){var r=e[t];e[t]=r&&"object"==typeof r?deepFreeze(r):r}return Object.freeze(e)}assignToNamespace("Monster.Util",deepFreeze);export{Monster,deepFreeze};
@@ -1,2 +1,2 @@
1
- /** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
1
+ /** Monster 1.15.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
2
2
  "use strict";const namespace="Monster.Util";