Skip to content
Snippets Groups Projects
Verified Commit c3049ee8 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

bugfix

parent 32bec503
No related branches found
No related tags found
No related merge requests found
Showing
with 30 additions and 30 deletions
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -40,7 +40,7 @@ For some functions you need additional [polyfills](#polyfill). ...@@ -40,7 +40,7 @@ For some functions you need additional [polyfills](#polyfill).
<script type="module"> <script type="module">
import { import {
Monster Monster
} from 'https://unpkg.com/@schukai/monster@1.30.0/dist/modules/monster.js'; } from 'https://unpkg.com/@schukai/monster@1.30.1/dist/modules/monster.js';
let id = document.getElementById('version'); let id = document.getElementById('version');
id.innerHTML = Monster.getVersion(); id.innerHTML = Monster.getVersion();
</script> </script>
...@@ -51,8 +51,8 @@ For some functions you need additional [polyfills](#polyfill). ...@@ -51,8 +51,8 @@ For some functions you need additional [polyfills](#polyfill).
`nomodule` for backwards compatibility `nomodule` for backwards compatibility
``` ```
<script type="module" src="https://unpkg.com/@schukai/monster@1.30.0/dist/modules/monster.js"></script> <script type="module" src="https://unpkg.com/@schukai/monster@1.30.1/dist/modules/monster.js"></script>
<script nomodule src="https://unpkg.com/@schukai/monster@1.30.0/dist/monster.js"></script> <script nomodule src="https://unpkg.com/@schukai/monster@1.30.1/dist/monster.js"></script>
``` ```
### Polyfill ### Polyfill
......
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster}from"./namespace.js";const internalSymbol=Symbol("internalData"),internalStateSymbol=Symbol("state");export{Monster,internalSymbol,internalStateSymbol}; "use strict";import{Monster}from"./namespace.js";const internalSymbol=Symbol("internalData"),internalStateSymbol=Symbol("state");export{Monster,internalSymbol,internalStateSymbol};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";class AbstractConstraint extends Base{constructor(){super()}isValid(s){return Promise.reject(s)}}assignToNamespace("Monster.Constraints",AbstractConstraint);export{Monster,AbstractConstraint}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{Base}from"../types/base.js";class AbstractConstraint extends Base{constructor(){super()}isValid(s){return Promise.reject(s)}}assignToNamespace("Monster.Constraints",AbstractConstraint);export{Monster,AbstractConstraint};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class AbstractOperator extends AbstractConstraint{constructor(t,r){if(super(),!(t instanceof AbstractConstraint&&r instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");this.operantA=t,this.operantB=r}}assignToNamespace("Monster.Constraints",AbstractOperator);export{Monster,AbstractOperator}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class AbstractOperator extends AbstractConstraint{constructor(t,r){if(super(),!(t instanceof AbstractConstraint&&r instanceof AbstractConstraint))throw new TypeError("parameters must be from type AbstractConstraint");this.operantA=t,this.operantB=r}}assignToNamespace("Monster.Constraints",AbstractOperator);export{Monster,AbstractOperator};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class AndOperator extends AbstractOperator{isValid(r){return Promise.all([this.operantA.isValid(r),this.operantB.isValid(r)])}}assignToNamespace("Monster.Constraints",AndOperator);export{Monster,AndOperator}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class AndOperator extends AbstractOperator{isValid(r){return Promise.all([this.operantA.isValid(r),this.operantB.isValid(r)])}}assignToNamespace("Monster.Constraints",AndOperator);export{Monster,AndOperator};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Invalid extends AbstractConstraint{isValid(s){return Promise.reject(s)}}assignToNamespace("Monster.Constraints",Invalid);export{Monster,Invalid}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Invalid extends AbstractConstraint{isValid(s){return Promise.reject(s)}}assignToNamespace("Monster.Constraints",Invalid);export{Monster,Invalid};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsArray extends AbstractConstraint{isValid(s){return isArray(s)?Promise.resolve(s):Promise.reject(s)}}assignToNamespace("Monster.Constraints",IsArray);export{Monster,IsArray}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isArray}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsArray extends AbstractConstraint{isValid(s){return isArray(s)?Promise.resolve(s):Promise.reject(s)}}assignToNamespace("Monster.Constraints",IsArray);export{Monster,IsArray};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsObject extends AbstractConstraint{isValid(s){return isObject(s)?Promise.resolve(s):Promise.reject(s)}}assignToNamespace("Monster.Constraints",IsObject);export{Monster,IsObject}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isObject}from"../types/is.js";import{AbstractConstraint}from"./abstract.js";class IsObject extends AbstractConstraint{isValid(s){return isObject(s)?Promise.resolve(s):Promise.reject(s)}}assignToNamespace("Monster.Constraints",IsObject);export{Monster,IsObject};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";const namespace="Monster.Constraints";export{namespace}; "use strict";const namespace="Monster.Constraints";export{namespace};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class OrOperator extends AbstractOperator{isValid(s){var o=this;return new Promise(function(t,r){let a,e;o.operantA.isValid(s).then(function(){t()}).catch(function(){(a=!1)===e&&r()}),o.operantB.isValid(s).then(function(){t()}).catch(function(){(e=!1)===a&&r()})})}}assignToNamespace("Monster.Constraints",OrOperator);export{Monster,OrOperator}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractOperator}from"./abstractoperator.js";class OrOperator extends AbstractOperator{isValid(s){var o=this;return new Promise(function(t,r){let a,e;o.operantA.isValid(s).then(function(){t()}).catch(function(){(a=!1)===e&&r()}),o.operantB.isValid(s).then(function(){t()}).catch(function(){(e=!1)===a&&r()})})}}assignToNamespace("Monster.Constraints",OrOperator);export{Monster,OrOperator};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Valid extends AbstractConstraint{isValid(s){return Promise.resolve(s)}}assignToNamespace("Monster.Constraints",Valid);export{Monster,Valid}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{AbstractConstraint}from"./abstract.js";class Valid extends AbstractConstraint{isValid(s){return Promise.resolve(s)}}assignToNamespace("Monster.Constraints",Valid);export{Monster,Valid};
\ No newline at end of file
/** Monster 1.30.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */ /** Monster 1.30.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isFunction,isObject,isString}from"../types/is.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{DELIMITER,Pathfinder,WILDCARD}from"./pathfinder.js";const PARENT="^";function buildMap(t,e,a,n,i){return assembleParts(t,e,i,function(t,e,i){e=build(t,n,e),t=build(t,a),this.set(e,t)})}function assembleParts(t,e,a,n){const r=new Map;let i;if(isFunction(e)){if(i=e(t),!(i instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(e))throw new TypeError("selector is neither a string nor a function");i=new Map,buildFlatMap.call(i,t,e)}return i instanceof Map&&i.forEach((t,e,i)=>{isFunction(a)&&!0!==a.call(i,t,e)||n.call(r,t,e,i)}),r}function buildFlatMap(i,e,a,n){var r=this;const s=new Map;var f=r.size;void 0===a&&(a=[]);let o=e.split(DELIMITER),t,l=[];do{if(t=o.shift(),l.push(t),t===WILDCARD){let t=new Pathfinder(i),e;try{e=t.getVia(l.join(DELIMITER))}catch(t){e=new Map}for(const[c,p]of e){let e=clone(a);l.map(t=>{e.push(t===WILDCARD?c:t)});var u=e.join(DELIMITER);let t=buildFlatMap.call(r,p,o.join(DELIMITER),e,p);isObject(t)&&void 0!==n&&(t[PARENT]=n),s.set(u,t)}}}while(0<o.length);if(f===r.size)for(var[d,h]of s)r.set(d,h);return i}function build(t,a,n){if(void 0===a)return n||t;validateString(a);const e=[...a.matchAll(/(?<placeholder>\${(?<path>[a-z\^A-Z.\-_0-9]*)})/gm)];let r=new Pathfinder(t);return 0===e.length?r.getVia(a):(e.forEach(e=>{var e=e?.groups,i=e?.placeholder;if(void 0!==i){e=e?.path;let t=r.getVia(e);void 0===t&&(t=n),a=a.replaceAll(i,t)}}),a)}assignToNamespace("Monster.Data",buildMap);export{PARENT,Monster,buildMap,assembleParts}; "use strict";import{assignToNamespace,Monster}from"../namespace.js";import{isFunction,isObject,isString}from"../types/is.js";import{validateString}from"../types/validate.js";import{clone}from"../util/clone.js";import{DELIMITER,Pathfinder,WILDCARD}from"./pathfinder.js";const PARENT="^";function buildMap(t,e,a,n,i){return assembleParts(t,e,i,function(t,e,i){e=build(t,n,e),t=build(t,a),this.set(e,t)})}function assembleParts(t,e,a,n){const r=new Map;let i;if(isFunction(e)){if(i=e(t),!(i instanceof Map))throw new TypeError("the selector callback must return a map")}else{if(!isString(e))throw new TypeError("selector is neither a string nor a function");i=new Map,buildFlatMap.call(i,t,e)}return i instanceof Map&&i.forEach((t,e,i)=>{isFunction(a)&&!0!==a.call(i,t,e)||n.call(r,t,e,i)}),r}function buildFlatMap(i,e,a,n){var r=this;const s=new Map;var f=r.size;void 0===a&&(a=[]);let o=e.split(DELIMITER),t,l=[];do{if(t=o.shift(),l.push(t),t===WILDCARD){let t=new Pathfinder(i),e;try{e=t.getVia(l.join(DELIMITER))}catch(t){e=new Map}for(const[c,p]of e){let e=clone(a);l.map(t=>{e.push(t===WILDCARD?c:t)});var u=e.join(DELIMITER);let t=buildFlatMap.call(r,p,o.join(DELIMITER),e,p);isObject(t)&&void 0!==n&&(t[PARENT]=n),s.set(u,t)}}}while(0<o.length);if(f===r.size)for(var[d,h]of s)r.set(d,h);return i}function build(t,a,n){if(void 0===a)return n||t;validateString(a);const e=[...a.matchAll(/(?<placeholder>\${(?<path>[a-z\^A-Z.\-_0-9]*)})/gm)];let r=new Pathfinder(t);return 0===e.length?r.getVia(a):(e.forEach(e=>{var e=e?.groups,i=e?.placeholder;if(void 0!==i){e=e?.path;let t=r.getVia(e);void 0===t&&(t=n),a=a.replaceAll(i,t)}}),a)}assignToNamespace("Monster.Data",buildMap);export{PARENT,Monster,buildMap,assembleParts};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment