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

Merge branch 'MONSTER/-/d5f232d7-d529-42ae-be94-15c47cb5e508' into 'master'

Release 1.12.0

See merge request oss/libraries/javascript/monster!15
parents eeb97122 5989201f
No related branches found
No related tags found
No related merge requests found
Showing
with 21 additions and 21 deletions
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";const namespace="Monster.Constraints";
\ No newline at end of file
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster,AbstractOperator}from"./abstractoperator.js";class OrOperator extends AbstractOperator{isValid(o){var a=this;return new Promise(function(t,r){let e,n;a.operantA.isValid(o).then(function(){t()}).catch(function(){(e=!1)===n&&r()}),a.operantB.isValid(o).then(function(){t()}).catch(function(){(n=!1)===e&&r()})})}}Monster.assignToNamespace("Monster.Constraints",OrOperator);export{Monster,OrOperator};
\ No newline at end of file
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster,AbstractConstraint}from"./abstract.js";class Valid extends AbstractConstraint{isValid(s){return Promise.resolve(s)}}Monster.assignToNamespace("Monster.Constraints",Valid);export{Monster,Valid};
\ No newline at end of file
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster}from"../namespace.js";import{isFunction}from"../types/is.js";import{validateString}from"../types/validate.js";import{Pathfinder}from"./pathfinder.js";function buildMap(t,e,i,r,n){validateString(e);const o=new Map;let a=new Pathfinder(t),l=a.getVia(e);return l instanceof Map&&l.forEach((t,e,a)=>{isFunction(n)&&!0!==n.call(a,t,e)||(e=build(t,r,e),t=build(t,i),o.set(e,t))}),o}function build(t,a,e){if(void 0===a)return e||t;validateString(a);const i=[...a.matchAll(/(?<placeholder>\$\{(?<path>[a-z.-_0-9]*)\})/gm)];let r=new Pathfinder(t);return 0===i.length?r.getVia(a):(i.forEach(t=>{var e=t?.groups,t=e?.placeholder;void 0!==t&&(e=e?.path,e=r.getVia(e),a=a.replaceAll(t,e))}),a)}Monster.assignToNamespace("Monster.Data",buildMap);export{Monster,buildMap};
\ No newline at end of file
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster,isArray,isObject}from"../types/is.js";function Diff(e,t){return doDiff(e,t)}function getKeys(e,t,n){if(isArray(n)){const o=e.length>t.length?new Array(e.length):new Array(t.length);return o.fill(0),new Set(o.map((e,t)=>t))}return new Set(Object.keys(e).concat(Object.keys(t)))}function doDiff(t,n,e,o){var r=typeof t,s=typeof n;const i=e||[],a=o||[];return r==s&&"object"==r?getKeys(t,n,r).forEach(e=>{Object.prototype.hasOwnProperty.call(t,e)?Object.prototype.hasOwnProperty.call(n,e)?doDiff(t[e],n[e],i.concat(e),a):a.push(buildResult(t[e],n[e],"delete",i.concat(e))):a.push(buildResult(t[e],n[e],"add",i.concat(e)))}):void 0!==(s=getOperator(t,n,r,s))&&a.push(buildResult(t,n,s,e)),a}function buildResult(e,t,n,o){const r={operator:n,path:o};return"add"!==n&&(r.first={value:e,type:typeof e},!isObject(e)||void 0!==(e=Object.getPrototypeOf(e)?.constructor?.name)&&(r.first.instance=e)),"add"!==n&&"update"!==n||(r.second={value:t,type:typeof t},!isObject(t)||void 0!==(t=Object.getPrototypeOf(t)?.constructor?.name)&&(r.second.instance=t)),r}function isNotEqual(e,t){return typeof e!=typeof t||(e instanceof Date&&t instanceof Date?e.getTime()!==t.getTime():e!==t)}function getOperator(e,t){let n;var o=typeof e,r=typeof t;return"undefined"==o&&"undefined"!=r?n="add":"undefined"!=o&&"undefined"==r?n="delete":isNotEqual(e,t)&&(n="update"),n}Monster.assignToNamespace("Monster.Data",Diff);export{Monster,Diff};
\ No newline at end of file
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster,isObject}from"../types/is.js";function extend(){for(var e={},t=0;t<arguments.length;t++)if(isObject(e))for(var r in arguments[t])arguments[t].hasOwnProperty(r)&&(e[r]=isObject(arguments[t][r])?extend(e[r]||{},arguments[t][r]):arguments[t][r]);return e}Monster.assignToNamespace("Monster.Data",extend);export{Monster,extend};
\ No newline at end of file
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";const namespace="Monster.Data";
\ No newline at end of file
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.
/** Monster 1.11.1, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
/** Monster 1.12.0, © 2021 schukai GmbH, Released under the AGPL 3.0 License. */
"use strict";import{Monster,validateInstance,validateString}from"../types/validate.js";import{getDocument}from"./util.js";function fireEvent(e,t){var n;getDocument();if(e instanceof HTMLElement)"click"!==t?(n=new Event(validateString(t),{bubbles:!0,cancelable:!0}),e.dispatchEvent(n)):e.click();else{if(!(e instanceof HTMLCollection||e instanceof NodeList))throw new TypeError("value is not an instance of HTMLElement or HTMLCollection");for(var i of e)fireEvent(i,t)}}Monster.assignToNamespace("Monster.DOM",fireEvent);export{Monster,fireEvent};
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment