clientnode 4.0.1435 → 4.0.1437
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Lock.js +83 -94
- package/dist/Logger.js +163 -715
- package/dist/Semaphore.js +46 -81
- package/dist/array.js +337 -568
- package/dist/cli.js +37 -71
- package/dist/constants.js +110 -209
- package/dist/context.js +25 -229
- package/dist/cookie.js +48 -226
- package/dist/data-transfer.js +166 -725
- package/dist/datetime.js +241 -1059
- package/dist/domNode.js +277 -441
- package/dist/expression/evaluators.js +234 -1112
- package/dist/expression/helper.js +82 -135
- package/dist/expression/index.js +10 -1245
- package/dist/expression/indicator-functions.js +21 -239
- package/dist/expression/type.js +4 -34
- package/dist/filesystem.js +323 -309
- package/dist/function.js +51 -125
- package/dist/index.js +26 -2709
- package/dist/indicators.js +68 -440
- package/dist/module.js +78 -164
- package/dist/number.js +25 -423
- package/dist/object.js +771 -852
- package/dist/process.js +39 -245
- package/dist/property-types.js +96 -157
- package/dist/scope.js +56 -1825
- package/dist/string.js +603 -909
- package/dist/test-helper.js +171 -541
- package/dist/type.js +8 -37
- package/dist/utility.js +91 -336
- package/package.json +2 -2
- package/dist/Lock.d.ts +0 -39
- package/dist/Logger.d.ts +0 -102
- package/dist/Semaphore.d.ts +0 -29
- package/dist/array.d.ts +0 -150
- package/dist/bundle/Lock.js +0 -111
- package/dist/bundle/Logger.js +0 -705
- package/dist/bundle/Semaphore.js +0 -100
- package/dist/bundle/array.js +0 -648
- package/dist/bundle/cli.js +0 -85
- package/dist/bundle/constants.js +0 -225
- package/dist/bundle/context.js +0 -243
- package/dist/bundle/cookie.js +0 -262
- package/dist/bundle/data-transfer.js +0 -741
- package/dist/bundle/datetime.js +0 -1064
- package/dist/bundle/domNode.js +0 -471
- package/dist/bundle/expression/evaluators.js +0 -1115
- package/dist/bundle/expression/helper.js +0 -106
- package/dist/bundle/expression/index.js +0 -1223
- package/dist/bundle/expression/indicator-functions.js +0 -235
- package/dist/bundle/expression/type.js +0 -50
- package/dist/bundle/filesystem.js +0 -374
- package/dist/bundle/function.js +0 -105
- package/dist/bundle/index.js +0 -2686
- package/dist/bundle/indicators.js +0 -459
- package/dist/bundle/module.js +0 -180
- package/dist/bundle/number.js +0 -425
- package/dist/bundle/object.js +0 -1004
- package/dist/bundle/process.js +0 -275
- package/dist/bundle/property-types.js +0 -167
- package/dist/bundle/scope.js +0 -1808
- package/dist/bundle/string.js +0 -1095
- package/dist/bundle/test-helper.js +0 -690
- package/dist/bundle/type.js +0 -50
- package/dist/bundle/utility.js +0 -362
- package/dist/cli.d.ts +0 -31
- package/dist/compatible/Lock.js +0 -111
- package/dist/compatible/Logger.js +0 -705
- package/dist/compatible/Semaphore.js +0 -100
- package/dist/compatible/array.js +0 -648
- package/dist/compatible/cli.js +0 -85
- package/dist/compatible/constants.js +0 -225
- package/dist/compatible/context.js +0 -243
- package/dist/compatible/cookie.js +0 -262
- package/dist/compatible/data-transfer.js +0 -741
- package/dist/compatible/datetime.js +0 -1064
- package/dist/compatible/domNode.js +0 -471
- package/dist/compatible/expression/evaluators.js +0 -1115
- package/dist/compatible/expression/helper.js +0 -106
- package/dist/compatible/expression/index.js +0 -1223
- package/dist/compatible/expression/indicator-functions.js +0 -235
- package/dist/compatible/expression/type.js +0 -50
- package/dist/compatible/filesystem.js +0 -374
- package/dist/compatible/function.js +0 -105
- package/dist/compatible/index.js +0 -2686
- package/dist/compatible/indicators.js +0 -459
- package/dist/compatible/module.js +0 -180
- package/dist/compatible/number.js +0 -425
- package/dist/compatible/object.js +0 -1004
- package/dist/compatible/process.js +0 -275
- package/dist/compatible/property-types.js +0 -167
- package/dist/compatible/scope.js +0 -1808
- package/dist/compatible/string.js +0 -1095
- package/dist/compatible/test-helper.js +0 -690
- package/dist/compatible/type.js +0 -50
- package/dist/compatible/utility.js +0 -362
- package/dist/constants.d.ts +0 -99
- package/dist/context.d.ts +0 -8
- package/dist/cookie.d.ts +0 -31
- package/dist/data-transfer.d.ts +0 -45
- package/dist/datetime.d.ts +0 -37
- package/dist/domNode.d.ts +0 -82
- package/dist/expression/evaluators.d.ts +0 -55
- package/dist/expression/helper.d.ts +0 -4
- package/dist/expression/index.d.ts +0 -7
- package/dist/expression/indicator-functions.d.ts +0 -14
- package/dist/expression/type.d.ts +0 -70
- package/dist/filesystem.d.ts +0 -143
- package/dist/function.d.ts +0 -20
- package/dist/index.d.ts +0 -23
- package/dist/indicators.d.ts +0 -68
- package/dist/module.d.ts +0 -8
- package/dist/number.d.ts +0 -35
- package/dist/object.d.ts +0 -231
- package/dist/process.d.ts +0 -22
- package/dist/property-types.d.ts +0 -460
- package/dist/scope.d.ts +0 -44
- package/dist/string.d.ts +0 -312
- package/dist/test/Lock.d.ts +0 -1
- package/dist/test/Logger.d.ts +0 -1
- package/dist/test/Semaphore.d.ts +0 -1
- package/dist/test/array.d.ts +0 -1
- package/dist/test/cookie.d.ts +0 -1
- package/dist/test/data-transfer.d.ts +0 -1
- package/dist/test/datetime.d.ts +0 -1
- package/dist/test/domNode.d.ts +0 -1
- package/dist/test/expression/evaluators.d.ts +0 -1
- package/dist/test/expression/helper.d.ts +0 -1
- package/dist/test/expression/indicator-functions.d.ts +0 -1
- package/dist/test/filesystem.d.ts +0 -1
- package/dist/test/function.d.ts +0 -1
- package/dist/test/indicators.d.ts +0 -1
- package/dist/test/number.d.ts +0 -1
- package/dist/test/object.d.ts +0 -1
- package/dist/test/process.d.ts +0 -1
- package/dist/test/property-types.d.ts +0 -1
- package/dist/test/scope.d.ts +0 -1
- package/dist/test/string.d.ts +0 -1
- package/dist/test/utility.d.ts +0 -1
- package/dist/test-helper.d.ts +0 -143
- package/dist/type.d.ts +0 -230
- package/dist/utility.d.ts +0 -44
package/dist/bundle/object.js
DELETED
|
@@ -1,1004 +0,0 @@
|
|
|
1
|
-
'use strict';if(typeof module!=='undefined'&&module!==null&&eval('typeof require')!=='undefined'&&eval('require')!==null&&'main'in eval('require')&&eval('typeof require.main')!=='undefined'&&eval('require.main')!==null){var ORIGINAL_MAIN_MODULE=module;if(module!==eval('require.main')&&'paths'in module&&'paths'in eval('require.main')&&typeof __dirname!=='undefined'&&__dirname!==null)module.paths=eval('require.main.paths').concat(module.paths.filter(function(path){return eval('require.main.paths').includes(path)}))};if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
-
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
-
module.exports = factory();
|
|
4
|
-
else if(typeof define === 'function' && define.amd)
|
|
5
|
-
define("clientnode", [], factory);
|
|
6
|
-
else if(typeof exports === 'object')
|
|
7
|
-
exports["clientnode"] = factory();
|
|
8
|
-
else
|
|
9
|
-
root["clientnode"] = factory();
|
|
10
|
-
})(this, function() {
|
|
11
|
-
return /******/ (function() { // webpackBootstrap
|
|
12
|
-
/******/ var __webpack_modules__ = ([
|
|
13
|
-
/* 0 */
|
|
14
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
15
|
-
|
|
16
|
-
"use strict";
|
|
17
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
18
|
-
/* harmony export */ CLASS_TO_TYPE_MAPPING: function() { return /* binding */ CLASS_TO_TYPE_MAPPING; },
|
|
19
|
-
/* harmony export */ IGNORE_NULL_AND_UNDEFINED_SYMBOL: function() { return /* binding */ IGNORE_NULL_AND_UNDEFINED_SYMBOL; },
|
|
20
|
-
/* harmony export */ PLAIN_OBJECT_PROTOTYPES: function() { return /* binding */ PLAIN_OBJECT_PROTOTYPES; },
|
|
21
|
-
/* harmony export */ SPECIAL_REGEX_SEQUENCES: function() { return /* binding */ SPECIAL_REGEX_SEQUENCES; },
|
|
22
|
-
/* harmony export */ VALUE_COPY_SYMBOL: function() { return /* binding */ VALUE_COPY_SYMBOL; }
|
|
23
|
-
/* harmony export */ });
|
|
24
|
-
/* unused harmony exports DEFAULT_ENCODING, CLOSE_EVENT_NAMES, CONSOLE_METHODS, ABBREVIATIONS, ANIMATION_END_EVENT_NAMES, KEY_CODES, KEYBOARD_CODES, LOCALES, TRANSITION_END_EVENT_NAMES */
|
|
25
|
-
// #!/usr/bin/env babel-node
|
|
26
|
-
// -*- coding: utf-8 -*-
|
|
27
|
-
/** @module constants *//* !
|
|
28
|
-
region header
|
|
29
|
-
[Project page](https://torben.website/clientnode)
|
|
30
|
-
|
|
31
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
32
|
-
|
|
33
|
-
License
|
|
34
|
-
-------
|
|
35
|
-
|
|
36
|
-
This library written by Torben Sickert stands under a creative commons
|
|
37
|
-
naming 3.0 unported license.
|
|
38
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
39
|
-
endregion
|
|
40
|
-
*/var DEFAULT_ENCODING="utf8";var CLOSE_EVENT_NAMES=(/* unused pure expression or super */ null && (["close","exit","SIGINT","SIGTERM","SIGQUIT","uncaughtException"]));var CONSOLE_METHODS=(/* unused pure expression or super */ null && (["debug","error","info","log","warn"]));var VALUE_COPY_SYMBOL=Symbol.for("clientnodeValue");var IGNORE_NULL_AND_UNDEFINED_SYMBOL=Symbol.for("clientnodeIgnoreNullAndUndefined");// Lists all known abbreviation for proper camel case to delimited and back
|
|
41
|
-
// conversion.
|
|
42
|
-
var ABBREVIATIONS=(/* unused pure expression or super */ null && (["html","id","url","us","de","api","href"]));// Saves a string with all css3 browser specific animation end event names.
|
|
43
|
-
var ANIMATION_END_EVENT_NAMES="animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd";// String representation to object type name mapping.
|
|
44
|
-
var CLASS_TO_TYPE_MAPPING={"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Error]":"error","[object Function]":"function","[object Map]":"map","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object Set]":"set","[object String]":"string"};// Saves a mapping from key codes to their corresponding name.
|
|
45
|
-
var KEY_CODES=(/* unused pure expression or super */ null && ({BACKSPACE:8,SPACE:32,TAB:9,DELETE:46,ENTER:13,COMMA:188,PERIOD:190,END:35,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,HOME:36,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,PAGE_UP:33,PAGE_DOWN:34,UP:38,DOWN:40,LEFT:37,RIGHT:39}));var KEYBOARD_CODES=(/* unused pure expression or super */ null && ({BACKSPACE:"Backspace",SPACE:"Space",TAB:"Tab",DELETE:"Delete",ENTER:"Enter",COMMA:"Comma",PERIOD:"Period",END:"End",ESCAPE:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F111",F12:"F12",HOME:"Home",NUMPAD_ADD:"NumpadAdd",NUMPAD_SUBTRACT:"NumpadSubtract",NUMPAD_DECIMAL:"NumpadDecimal",NUMPAD_DIVIDE:"NumpadDivide",NUMPAD_ENTER:"NumpadEnter",NUMPAD_MULTIPLY:"NumpadMultiply",PAGE_UP:"PageUp",PAGE_DOWN:"PageUp",UP:"ArrowUp",DOWN:"ArrowDown",LEFT:"ArrowLeft",RIGHT:"ArrowUp"}));var LOCALES=(/* unused pure expression or super */ null && ([]));var PLAIN_OBJECT_PROTOTYPES=[Object.prototype];// A list of special regular expression symbols.
|
|
46
|
-
var SPECIAL_REGEX_SEQUENCES=["-","[","]","(",")","^","$","*","+",".","{","}"];// Saves a string with all css3 browser specific transition end event names.
|
|
47
|
-
var TRANSITION_END_EVENT_NAMES="transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd";
|
|
48
|
-
|
|
49
|
-
/***/ }),
|
|
50
|
-
/* 1 */
|
|
51
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
52
|
-
|
|
53
|
-
"use strict";
|
|
54
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
55
|
-
/* harmony export */ determineGlobalContext: function() { return /* binding */ determineGlobalContext; },
|
|
56
|
-
/* harmony export */ optionalImport: function() { return /* binding */ optionalImport; },
|
|
57
|
-
/* harmony export */ optionalRequire: function() { return /* binding */ optionalRequire; }
|
|
58
|
-
/* harmony export */ });
|
|
59
|
-
/* unused harmony exports currentRequire, clearRequireCache, isolatedRequire, isImportSyntaxSupported */
|
|
60
|
-
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
61
|
-
// #!/usr/bin/env babel-node
|
|
62
|
-
// -*- coding: utf-8 -*-
|
|
63
|
-
/** @module module *//* !
|
|
64
|
-
region header
|
|
65
|
-
[Project page](https://torben.website/clientnode)
|
|
66
|
-
|
|
67
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
68
|
-
|
|
69
|
-
License
|
|
70
|
-
-------
|
|
71
|
-
|
|
72
|
-
This library written by Torben Sickert stands under a creative commons
|
|
73
|
-
naming 3.0 unported license.
|
|
74
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
75
|
-
endregion
|
|
76
|
-
*/function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}var determineGlobalContext=function determineGlobalContext(){if(typeof globalThis==="undefined"){if(typeof window==="undefined"){if(typeof __webpack_require__.g==="undefined")return false?0:module;if(Object.prototype.hasOwnProperty.call(__webpack_require__.g,"window"))return __webpack_require__.g.window;return __webpack_require__.g}return window}return globalThis};var globalContext=determineGlobalContext();// Make preprocessed require function available at runtime.
|
|
77
|
-
var currentRequire=typeof globalContext.require==="undefined"?null:globalContext.require;var optionalRequire=function optionalRequire(id){try{return currentRequire?currentRequire(id):null}catch(_unused){return null}};var clearRequireCache=function clearRequireCache(cache){if(cache===void 0){cache=(currentRequire===null||currentRequire===void 0?void 0:currentRequire.cache)||__webpack_require__.c}var backup={};for(var _i=0,_Object$entries=Object.entries(cache);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],_module=_Object$entries$_i[1];backup[key]=_module;delete cache[key]}return backup};var restoreRequireCache=function restoreRequireCache(cache,backup){if(cache===void 0){cache=(currentRequire===null||currentRequire===void 0?void 0:currentRequire.cache)||__webpack_require__.c}clearRequireCache();for(var _i2=0,_Object$entries2=Object.entries(backup);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=_slicedToArray(_Object$entries2[_i2],2),key=_Object$entries2$_i[0],_module2=_Object$entries2$_i[1];cache[key]=_module2}};var isolatedRequire=function isolatedRequire(path,requireFunction){if(requireFunction===void 0){requireFunction=currentRequire||__webpack_require__(5)}var backup=clearRequireCache(requireFunction.cache);try{return requireFunction(path);// eslint-disable-next-line no-useless-catch
|
|
78
|
-
}catch(error){throw error}finally{restoreRequireCache(requireFunction.cache,backup)}};// Make preprocessed import function available at runtime.
|
|
79
|
-
var isImportSyntaxSupported=function isImportSyntaxSupported(){try{// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
80
|
-
new Function("import(\"data:text/javascript,\")");return true}catch(_unused2){return false}};var optionalImport=/*#__PURE__*/function(){var _optionalImport=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(id,options){var _t,_t2;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(options===void 0){options={}}_context.p=1;if(!isImportSyntaxSupported()){_context.n=3;break}_context.n=2;return new Function("options","return import('".concat(id,"', options)"))(options);case 2:_t=_context.v;_context.n=5;break;case 3:_context.n=4;return Promise.resolve(null);case 4:_t=_context.v;case 5:return _context.a(2,_t);case 6:_context.p=6;_t2=_context.v;_context.n=7;return Promise.resolve(null);case 7:return _context.a(2,_context.v)}},_callee,null,[[1,6]])}));function optionalImport(_x,_x2){return _optionalImport.apply(this,arguments)}return optionalImport}();
|
|
81
|
-
|
|
82
|
-
/***/ }),
|
|
83
|
-
/* 2 */
|
|
84
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
85
|
-
|
|
86
|
-
"use strict";
|
|
87
|
-
__webpack_require__.r(__webpack_exports__);
|
|
88
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
89
|
-
/* harmony export */ addDynamicGetterAndSetter: function() { return /* binding */ _addDynamicGetterAndSetter; },
|
|
90
|
-
/* harmony export */ convertCircularObjectToJSON: function() { return /* binding */ convertCircularObjectToJSON; },
|
|
91
|
-
/* harmony export */ convertMapToPlainObject: function() { return /* binding */ _convertMapToPlainObject; },
|
|
92
|
-
/* harmony export */ convertPlainObjectToMap: function() { return /* binding */ _convertPlainObjectToMap; },
|
|
93
|
-
/* harmony export */ convertSubstringInPlainObject: function() { return /* binding */ _convertSubstringInPlainObject; },
|
|
94
|
-
/* harmony export */ copy: function() { return /* binding */ _copy; },
|
|
95
|
-
/* harmony export */ determineType: function() { return /* binding */ determineType; },
|
|
96
|
-
/* harmony export */ equals: function() { return /* binding */ _equals; },
|
|
97
|
-
/* harmony export */ evaluateAsyncDynamicData: function() { return /* binding */ _evaluateAsyncDynamicData; },
|
|
98
|
-
/* harmony export */ evaluateDynamicData: function() { return /* binding */ evaluateDynamicData; },
|
|
99
|
-
/* harmony export */ extend: function() { return /* binding */ _extend; },
|
|
100
|
-
/* harmony export */ getProxyHandler: function() { return /* binding */ getProxyHandler; },
|
|
101
|
-
/* harmony export */ mask: function() { return /* binding */ _mask; },
|
|
102
|
-
/* harmony export */ modifyObject: function() { return /* binding */ _modifyObject; },
|
|
103
|
-
/* harmony export */ removeKeyPrefixes: function() { return /* binding */ _removeKeyPrefixes; },
|
|
104
|
-
/* harmony export */ removeKeysInEvaluation: function() { return /* binding */ _removeKeysInEvaluation; },
|
|
105
|
-
/* harmony export */ represent: function() { return /* binding */ _represent; },
|
|
106
|
-
/* harmony export */ sort: function() { return /* binding */ sort; },
|
|
107
|
-
/* harmony export */ unwrapProxy: function() { return /* binding */ _unwrapProxy; }
|
|
108
|
-
/* harmony export */ });
|
|
109
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
110
|
-
/* harmony import */ var _indicators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
|
111
|
-
/* harmony import */ var _number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
|
|
112
|
-
/* harmony import */ var _string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
|
|
113
|
-
// #!/usr/bin/env babel-node
|
|
114
|
-
// -*- coding: utf-8 -*-
|
|
115
|
-
/** @module object *//* !
|
|
116
|
-
region header
|
|
117
|
-
[Project page](https://torben.website/clientnode)
|
|
118
|
-
|
|
119
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
120
|
-
|
|
121
|
-
License
|
|
122
|
-
-------
|
|
123
|
-
|
|
124
|
-
This library written by Torben Sickert stands under a creative commons
|
|
125
|
-
naming 3.0 unported license.
|
|
126
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
127
|
-
endregion
|
|
128
|
-
*/function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}/**
|
|
129
|
-
* Adds dynamic getter and setter to any given data structure such as maps.
|
|
130
|
-
* @param object - Object to proxy.
|
|
131
|
-
* @param getterWrapper - Function to wrap each property get.
|
|
132
|
-
* @param setterWrapper - Function to wrap each property set.
|
|
133
|
-
* @param methodNames - Method names to perform actions on the given
|
|
134
|
-
* object.
|
|
135
|
-
* @param deep - Indicates to perform a deep wrapping of specified types.
|
|
136
|
-
* @param typesToExtend - Types which should be extended (Checks are
|
|
137
|
-
* performed via "value instanceof type".).
|
|
138
|
-
* @returns Returns given object wrapped with a dynamic getter proxy.
|
|
139
|
-
*/var _addDynamicGetterAndSetter=function addDynamicGetterAndSetter(object,getterWrapper,setterWrapper,methodNames,deep,typesToExtend){if(getterWrapper===void 0){getterWrapper=null}if(setterWrapper===void 0){setterWrapper=null}if(methodNames===void 0){methodNames={}}if(deep===void 0){deep=true}if(typesToExtend===void 0){typesToExtend=[Object]}if(deep&&_typeof(object)==="object")if(Array.isArray(object)){var index=0;var _iterator=_createForOfIteratorHelper(object),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var value=_step.value;object[index]=_addDynamicGetterAndSetter(value,getterWrapper,setterWrapper,methodNames,deep);index+=1}}catch(err){_iterator.e(err)}finally{_iterator.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var _iterator2=_createForOfIteratorHelper(object),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _step2$value=_slicedToArray(_step2.value,2),key=_step2$value[0],_value=_step2$value[1];object.set(key,_addDynamicGetterAndSetter(_value,getterWrapper,setterWrapper,methodNames,deep))}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(object)){var cache=[];var _iterator3=_createForOfIteratorHelper(object),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var _value3=_step3.value;object.delete(_value3);cache.push(_addDynamicGetterAndSetter(_value3,getterWrapper,setterWrapper,methodNames,deep))}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}for(var _i=0,_cache=cache;_i<_cache.length;_i++){var _value2=_cache[_i];object.add(_value2)}}else if(object!==null)for(var _i2=0,_Object$entries=Object.entries(object);_i2<_Object$entries.length;_i2++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i2],2),_key=_Object$entries$_i[0],_value4=_Object$entries$_i[1];object[_key]=_addDynamicGetterAndSetter(_value4,getterWrapper,setterWrapper,methodNames,deep)}if(getterWrapper||setterWrapper){var _iterator4=_createForOfIteratorHelper(typesToExtend),_step4;try{var _loop=function _loop(){var type=_step4.value;if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(object)&&object instanceof type){var defaultHandler=getProxyHandler(object,methodNames);var handler=getProxyHandler(object,methodNames);if(getterWrapper)handler.get=function(_target,name){if(name==="__target__")return object;if(name==="__revoke__")return function(){revoke();return object};if(typeof object[name]==="function")return object[name];return getterWrapper(defaultHandler.get(proxy,name),name,object)};if(setterWrapper)handler.set=function(_target,name,value){return defaultHandler.set(proxy,name,setterWrapper(name,value,object))};var _Proxy$revocable=Proxy.revocable({},handler),proxy=_Proxy$revocable.proxy,revoke=_Proxy$revocable.revoke;return{v:proxy}}},_ret;for(_iterator4.s();!(_step4=_iterator4.n()).done;){_ret=_loop();if(_ret)return _ret.v}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}return object};/**
|
|
140
|
-
* Converts given object into its serialized JSON representation by
|
|
141
|
-
* replacing circular references with a given provided value.
|
|
142
|
-
*
|
|
143
|
-
* This method traverses given object recursively and tracks of seen and
|
|
144
|
-
* already serialized structures to reuse generated strings or mark a
|
|
145
|
-
* circular reference.
|
|
146
|
-
* @param object - Object to serialize.
|
|
147
|
-
* @param determineCircularReferenceValue - Callback to create a fallback
|
|
148
|
-
* value depending on given redundant value.
|
|
149
|
-
* @param numberOfSpaces - Number of spaces to use for string formatting.
|
|
150
|
-
* @returns The formatted JSON string.
|
|
151
|
-
*/var convertCircularObjectToJSON=function convertCircularObjectToJSON(object,determineCircularReferenceValue,numberOfSpaces){if(determineCircularReferenceValue===void 0){determineCircularReferenceValue=function determineCircularReferenceValue(serializedValue){return serializedValue!==null&&serializedValue!==void 0?serializedValue:"__circularReference__"}}if(numberOfSpaces===void 0){numberOfSpaces=0}var seenObjects=new Map;var stringifier=function stringifier(object){var _replacer=function replacer(key,value){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(value)){var _seenObjects$get;if(seenObjects.has(value))return determineCircularReferenceValue((_seenObjects$get=seenObjects.get(value))!==null&&_seenObjects$get!==void 0?_seenObjects$get:null,key,value,seenObjects);// NOTE: Set before traversing deeper to detect cycles.
|
|
152
|
-
seenObjects.set(value,null);var result;if(Array.isArray(value)){result=[];var _iterator5=_createForOfIteratorHelper(value),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var item=_step5.value;result.push(_replacer(null,item))}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}else{result={};for(var _i3=0,_Object$entries2=Object.entries(value);_i3<_Object$entries2.length;_i3++){var _Object$entries2$_i=_slicedToArray(_Object$entries2[_i3],2),name=_Object$entries2$_i[0],subValue=_Object$entries2$_i[1];result[name]=_replacer(name,subValue)}}seenObjects.set(value,result);return result}return value};return JSON.stringify(object,_replacer,numberOfSpaces)};return stringifier(object)};/**
|
|
153
|
-
* Converts given map and all nested found maps objects to corresponding
|
|
154
|
-
* object.
|
|
155
|
-
* @param object - Map to convert to.
|
|
156
|
-
* @param deep - Indicates whether to perform a recursive conversion.
|
|
157
|
-
* @returns Given map as object.
|
|
158
|
-
*/var _convertMapToPlainObject=function convertMapToPlainObject(object,deep){if(deep===void 0){deep=true}if(_typeof(object)==="object"){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var newObject={};var _iterator6=_createForOfIteratorHelper(object),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _step6$value=_slicedToArray(_step6.value,2),key=_step6$value[0],value=_step6$value[1];if(deep)value=_convertMapToPlainObject(value,deep);if(["number","string"].includes(_typeof(key)))newObject[String(key)]=value}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}return newObject}if(deep)if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(object))for(var _i4=0,_Object$entries3=Object.entries(object);_i4<_Object$entries3.length;_i4++){var _Object$entries3$_i=_slicedToArray(_Object$entries3[_i4],2),_key2=_Object$entries3$_i[0],_value5=_Object$entries3$_i[1];object[_key2]=_convertMapToPlainObject(_value5,deep)}else if(Array.isArray(object)){var index=0;for(var _i5=0,_arr=object;_i5<_arr.length;_i5++){var _value6=_arr[_i5];object[index]=_convertMapToPlainObject(_value6,deep);index+=1}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(object)){var cache=[];var _iterator7=_createForOfIteratorHelper(object),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var _value8=_step7.value;object.delete(_value8);cache.push(_convertMapToPlainObject(_value8,deep))}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}for(var _i6=0,_cache2=cache;_i6<_cache2.length;_i6++){var _value7=_cache2[_i6];object.add(_value7)}}}return object};/**
|
|
159
|
-
* Converts given plain object and all nested found objects to
|
|
160
|
-
* corresponding map.
|
|
161
|
-
* @param object - Object to convert to.
|
|
162
|
-
* @param deep - Indicates whether to perform a recursive conversion.
|
|
163
|
-
* @returns Given object as map.
|
|
164
|
-
*/var _convertPlainObjectToMap=function convertPlainObjectToMap(object,deep){if(deep===void 0){deep=true}if(_typeof(object)==="object"){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(object)){var newObject=new Map;for(var _i7=0,_Object$entries4=Object.entries(object);_i7<_Object$entries4.length;_i7++){var _Object$entries4$_i=_slicedToArray(_Object$entries4[_i7],2),key=_Object$entries4$_i[0],value=_Object$entries4$_i[1];if(deep)object[key]=_convertPlainObjectToMap(value,deep);newObject.set(key,object[key])}return newObject}if(deep)if(Array.isArray(object)){var index=0;for(var _i8=0,_arr2=object;_i8<_arr2.length;_i8++){var _value9=_arr2[_i8];object[index]=_convertPlainObjectToMap(_value9,deep);index+=1}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var _iterator8=_createForOfIteratorHelper(object),_step8;try{for(_iterator8.s();!(_step8=_iterator8.n()).done;){var _step8$value=_slicedToArray(_step8.value,2),_key3=_step8$value[0],_value0=_step8$value[1];object.set(_key3,_convertPlainObjectToMap(_value0,deep))}}catch(err){_iterator8.e(err)}finally{_iterator8.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(object)){var cache=[];var _iterator9=_createForOfIteratorHelper(object),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var _value10=_step9.value;object.delete(_value10);cache.push(_convertPlainObjectToMap(_value10,deep))}}catch(err){_iterator9.e(err)}finally{_iterator9.f()}for(var _i9=0,_cache3=cache;_i9<_cache3.length;_i9++){var _value1=_cache3[_i9];object.add(_value1)}}}return object};/**
|
|
165
|
-
* Replaces given pattern in each value in given object recursively with
|
|
166
|
-
* given string replacement.
|
|
167
|
-
* @param object - Object to convert substrings in.
|
|
168
|
-
* @param pattern - Regular expression to replace.
|
|
169
|
-
* @param replacement - String to use as replacement for found patterns.
|
|
170
|
-
* @returns Converted object with replaced patterns.
|
|
171
|
-
*/var _convertSubstringInPlainObject=function convertSubstringInPlainObject(object,pattern,replacement){for(var _i0=0,_Object$entries5=Object.entries(object);_i0<_Object$entries5.length;_i0++){var _Object$entries5$_i=_slicedToArray(_Object$entries5[_i0],2),key=_Object$entries5$_i[0],value=_Object$entries5$_i[1];if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value))object[key]=_convertSubstringInPlainObject(value,pattern,replacement);else if(typeof value==="string")object[key]=value.replace(pattern,replacement)}return object};/* eslint-disable jsdoc/require-description-complete-sentence *//**
|
|
172
|
-
* Copies given object (of any type) into optionally given destination.
|
|
173
|
-
* @param source - Object to copy.
|
|
174
|
-
* @param copyBlobs - Determines whether to copy blobs as well.
|
|
175
|
-
* @param recursionLimit - Specifies how deep we should traverse into given
|
|
176
|
-
* object recursively.
|
|
177
|
-
* @param recursionEndValue - Indicates which value to use for recursion ends.
|
|
178
|
-
* Usually a reference to corresponding source value will be used.
|
|
179
|
-
* @param destination - Target to copy source to.
|
|
180
|
-
* @param cyclic - Indicates whether known sub structures should be copied or
|
|
181
|
-
* referenced (if "true" endless loops can occur if source has cyclic
|
|
182
|
-
* structures).
|
|
183
|
-
* @param knownReferences - Used to avoid traversing loops and not to copy
|
|
184
|
-
* references e.g. to objects not to copy (e.g. symbol polyfills).
|
|
185
|
-
* @param recursionLevel - Internally used to track current recursion level in
|
|
186
|
-
* given source data structure.
|
|
187
|
-
* @returns Value "true" if both objects are equal and "false" otherwise.
|
|
188
|
-
*/var _copy=function copy(source,copyBlobs,recursionLimit,recursionEndValue,destination,cyclic,knownReferences,recursionLevel){if(copyBlobs===void 0){copyBlobs=false}if(recursionLimit===void 0){recursionLimit=-1}if(recursionEndValue===void 0){recursionEndValue=_constants__WEBPACK_IMPORTED_MODULE_0__.VALUE_COPY_SYMBOL}if(destination===void 0){destination=null}if(cyclic===void 0){cyclic=false}if(knownReferences===void 0){knownReferences=[]}if(recursionLevel===void 0){recursionLevel=0}/* eslint-enable jsdoc/require-description-complete-sentence */if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(source))if(destination){if(source===destination)throw new Error("Can't copy because source and destination are "+"identical.");if(!cyclic&&![undefined,null].includes(source)){var index=knownReferences.indexOf(source);if(index!==-1)return knownReferences[index];knownReferences.push(source)}var copyValue=function copyValue(value){if(recursionLimit!==-1&&recursionLimit<recursionLevel+1)return recursionEndValue===_constants__WEBPACK_IMPORTED_MODULE_0__.VALUE_COPY_SYMBOL?value:recursionEndValue;var result=_copy(value,copyBlobs,recursionLimit,recursionEndValue,null,cyclic,knownReferences,recursionLevel+1);if(!cyclic&&![undefined,null].includes(value)&&_typeof(value)==="object")knownReferences.push(value);return result};if(Array.isArray(source)){var _iterator0=_createForOfIteratorHelper(source),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var item=_step0.value;destination.push(copyValue(item))}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}}else if(source instanceof Map){var _iterator1=_createForOfIteratorHelper(source),_step1;try{for(_iterator1.s();!(_step1=_iterator1.n()).done;){var _step1$value=_slicedToArray(_step1.value,2),key=_step1$value[0],value=_step1$value[1];destination.set(key,copyValue(value))}}catch(err){_iterator1.e(err)}finally{_iterator1.f()}}else if(source instanceof Set){var _iterator10=_createForOfIteratorHelper(source),_step10;try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){var _value11=_step10.value;destination.add(copyValue(_value11))}}catch(err){_iterator10.e(err)}finally{_iterator10.f()}}else for(var _i1=0,_Object$entries6=Object.entries(source);_i1<_Object$entries6.length;_i1++){var _Object$entries6$_i=_slicedToArray(_Object$entries6[_i1],2),_key4=_Object$entries6$_i[0],_value12=_Object$entries6$_i[1];try{destination[_key4]=copyValue(_value12)}catch(error){throw new Error("Failed to copy property value object \""+"".concat(_key4,"\": ").concat(_represent(error)),{cause:error})}}}else{if(Array.isArray(source))return _copy(source,copyBlobs,recursionLimit,recursionEndValue,[],cyclic,knownReferences,recursionLevel);if(source instanceof Map)return _copy(source,copyBlobs,recursionLimit,recursionEndValue,new Map,cyclic,knownReferences,recursionLevel);if(source instanceof Set)return _copy(source,copyBlobs,recursionLimit,recursionEndValue,new Set,cyclic,knownReferences,recursionLevel);if(source instanceof Date)return new Date(source.getTime());if(source instanceof RegExp){var modifier=/[^/]*$/.exec(source.toString());destination=new RegExp(source.source,modifier?modifier[0]:undefined);destination.lastIndex=source.lastIndex;return destination}if(typeof Blob!=="undefined"&&source instanceof Blob)return copyBlobs?source.slice(0,source.size,source.type):source;return _copy(source,copyBlobs,recursionLimit,recursionEndValue,{},cyclic,knownReferences,recursionLevel)}return destination||source};/**
|
|
189
|
-
* Determine the internal JavaScript [[Class]] of an object.
|
|
190
|
-
* @param value - Value to analyze.
|
|
191
|
-
* @returns Name of determined type.
|
|
192
|
-
*/var determineType=function determineType(value){if([null,undefined].includes(value))return String(value);var type=_typeof(value);if(["function","object"].includes(type)&&"toString"in value){var stringRepresentation=Object.prototype.toString.call(value);if(Object.prototype.hasOwnProperty.call(_constants__WEBPACK_IMPORTED_MODULE_0__.CLASS_TO_TYPE_MAPPING,stringRepresentation))return _constants__WEBPACK_IMPORTED_MODULE_0__.CLASS_TO_TYPE_MAPPING[stringRepresentation]}return type};/**
|
|
193
|
-
* Returns true if given items are equal for given property list. If
|
|
194
|
-
* property list isn't set all properties will be checked. All keys which
|
|
195
|
-
* starts with one of the exception prefixes will be omitted.
|
|
196
|
-
* @param firstValue - First object to compare.
|
|
197
|
-
* @param secondValue - Second object to compare.
|
|
198
|
-
* @param givenOptions - Options to define how to compare.
|
|
199
|
-
* @param givenOptions.properties - Property names to check. Check all if
|
|
200
|
-
* "null" is selected (default).
|
|
201
|
-
* @param givenOptions.deep - Recursion depth negative values means
|
|
202
|
-
* infinitely deep (default).
|
|
203
|
-
* @param givenOptions.exceptionPrefixes - Property prefixes which
|
|
204
|
-
* indicates properties to ignore.
|
|
205
|
-
* @param givenOptions.ignoreFunctions - Indicates whether functions have
|
|
206
|
-
* to be identical to interpret is as equal. If set to "true" two functions
|
|
207
|
-
* will be assumed to be equal (default).
|
|
208
|
-
* @param givenOptions.compareBlobs - Indicates whether binary data should
|
|
209
|
-
* be converted to a base64 string to compare their content. Makes this
|
|
210
|
-
* function asynchronous in browsers and potentially takes a lot of
|
|
211
|
-
* resources.
|
|
212
|
-
* @returns Value "true" if both objects are equal and "false" otherwise.
|
|
213
|
-
* If "compareBlobs" is activated, and we're running in a browser like
|
|
214
|
-
* environment and binary data is given, then a promise wrapping the
|
|
215
|
-
* determined boolean values is returned.
|
|
216
|
-
*/var _equals=function equals(firstValue,secondValue,givenOptions){if(givenOptions===void 0){givenOptions={}}var options=_objectSpread({compareBlobs:false,deep:-1,exceptionPrefixes:[],ignoreFunctions:true,properties:null,returnReasonIfNotEqual:false},givenOptions);if(options.ignoreFunctions&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isFunction)(firstValue)&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isFunction)(secondValue)||firstValue===secondValue||(0,_number__WEBPACK_IMPORTED_MODULE_2__.isNotANumber)(firstValue)&&(0,_number__WEBPACK_IMPORTED_MODULE_2__.isNotANumber)(secondValue)||firstValue instanceof RegExp&&secondValue instanceof RegExp&&firstValue.toString()===secondValue.toString()&&firstValue.flags.split("").sort().join("")===secondValue.flags.split("").sort().join("")||firstValue instanceof Date&&secondValue instanceof Date&&(isNaN(firstValue.getTime())&&isNaN(secondValue.getTime())||!isNaN(firstValue.getTime())&&!isNaN(secondValue.getTime())&&firstValue.getTime()===secondValue.getTime())||options.compareBlobs&&eval("typeof Buffer")!=="undefined"&&Object.prototype.hasOwnProperty.call(eval("Buffer"),"isBuffer")&&firstValue instanceof eval("Buffer")&&secondValue instanceof eval("Buffer")&&firstValue.toString("base64")===secondValue.toString("base64"))return true;if(options.compareBlobs&&typeof Blob!=="undefined"&&firstValue instanceof Blob&&secondValue instanceof Blob)return new Promise(function(resolve){var values=[];for(var _i10=0,_arr3=[firstValue,secondValue];_i10<_arr3.length;_i10++){var value=_arr3[_i10];var fileReader=new FileReader;fileReader.onload=function(event){if(event.target===null)values.push(null);else values.push(event.target.result);if(values.length===2)if(values[0]===values[1])resolve(true);else resolve(options.returnReasonIfNotEqual?">>> Blob(".concat(_represent(values[0]),") !== ")+"Blob(".concat(_represent(values[1]),")"):false)};fileReader.readAsDataURL(value)}});if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(firstValue)&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(secondValue)&&!(firstValue instanceof RegExp||secondValue instanceof RegExp)||Array.isArray(firstValue)&&Array.isArray(secondValue)&&firstValue.length===secondValue.length||determineType(firstValue)===determineType(secondValue)&&["map","set"].includes(determineType(firstValue))&&firstValue.size===secondValue.size){var promises=[];for(var _i11=0,_arr4=[[firstValue,secondValue],[secondValue,firstValue]];_i11<_arr4.length;_i11++){var _arr4$_i=_slicedToArray(_arr4[_i11],2),first=_arr4$_i[0],second=_arr4$_i[1];var firstIsArray=Array.isArray(first);if(firstIsArray&&(!Array.isArray(second)||first.length!==second.length))return options.returnReasonIfNotEqual?".length":false;var firstIsMap=(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(first);if(firstIsMap&&(!(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(second)||first.size!==second.size))return options.returnReasonIfNotEqual?".size":false;var firstIsSet=(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(first);if(firstIsSet&&(!(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(second)||first.size!==second.size))return options.returnReasonIfNotEqual?".size":false;if(firstIsArray){var index=0;var _loop2=function _loop2(){var value=_arr5[_i12];if(options.deep!==0){var result=_equals(value,second[index],_objectSpread(_objectSpread({},options),{},{deep:options.deep-1}));if(!result)return{v:false};var currentIndex=index;var determineResult=function determineResult(result){var _$$result$;return typeof result==="string"?"[".concat(String(currentIndex),"]")+((_$$result$={"[":"",">":" "}[result[0]])!==null&&_$$result$!==void 0?_$$result$:".")+result:result};if(Object.prototype.hasOwnProperty.call(result,"then"))promises.push(result.then(determineResult));if(typeof result==="string")return{v:determineResult(result)}}index+=1},_ret2;for(var _i12=0,_arr5=first;_i12<_arr5.length;_i12++){_ret2=_loop2();if(_ret2)return _ret2.v}}else if(firstIsMap){var _iterator11=_createForOfIteratorHelper(first),_step11;try{var _loop3=function _loop3(){var _step11$value=_slicedToArray(_step11.value,2),key=_step11$value[0],value=_step11$value[1];if(options.deep!==0){var result=_equals(value,second.get(key),_objectSpread(_objectSpread({},options),{},{deep:options.deep-1}));if(!result)return{v:false};var determineResult=function determineResult(result){var _$$result$2;return typeof result==="string"?"get(".concat(_represent(key),")")+((_$$result$2={"[":"",">":" "}[result[0]])!==null&&_$$result$2!==void 0?_$$result$2:".")+result:result};if(Object.prototype.hasOwnProperty.call(result,"then"))promises.push(result.then(determineResult));if(typeof result==="string")return{v:determineResult(result)}}},_ret3;for(_iterator11.s();!(_step11=_iterator11.n()).done;){_ret3=_loop3();if(_ret3)return _ret3.v}}catch(err){_iterator11.e(err)}finally{_iterator11.f()}}else if(firstIsSet){var _iterator12=_createForOfIteratorHelper(first),_step12;try{var _loop4=function _loop4(){var value=_step12.value;if(options.deep!==0){var equal=false;var subPromises=[];/*
|
|
217
|
-
NOTE: Check if their exists at least one being
|
|
218
|
-
equally.
|
|
219
|
-
*/var _iterator13=_createForOfIteratorHelper(second),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var _secondValue=_step13.value;var result=_equals(value,_secondValue,_objectSpread(_objectSpread({},options),{},{deep:options.deep-1}));if(typeof result==="boolean"){if(result){equal=true;break}}else subPromises.push(result)}}catch(err){_iterator13.e(err)}finally{_iterator13.f()}var determineResult=function determineResult(equal){return equal?true:options.returnReasonIfNotEqual?">>> {-> ".concat(_represent(value)," not found}"):false};if(equal)/*
|
|
220
|
-
NOTE: We do not have to wait for promises to be
|
|
221
|
-
resolved when one match could be found.
|
|
222
|
-
*/return 0;// continue
|
|
223
|
-
if(subPromises.length)promises.push(new Promise(function(resolve){Promise.all(subPromises).then(function(results){resolve(determineResult(results.some(function(result){return result})))},function(){// Do nothing.
|
|
224
|
-
})}));return{v:determineResult(false)}}},_ret4;for(_iterator12.s();!(_step12=_iterator12.n()).done;){_ret4=_loop4();if(_ret4===0)continue;if(_ret4)return _ret4.v}}catch(err){_iterator12.e(err)}finally{_iterator12.f()}}else{var _loop5=function _loop5(){var _Object$entries7$_i=_slicedToArray(_Object$entries7[_i13],2),key=_Object$entries7$_i[0],value=_Object$entries7$_i[1];if(options.properties&&!options.properties.includes(key))return 0;// break
|
|
225
|
-
var doBreak=false;var _iterator14=_createForOfIteratorHelper(options.exceptionPrefixes),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var exceptionPrefix=_step14.value;if(key.startsWith(exceptionPrefix)){doBreak=true;break}}}catch(err){_iterator14.e(err)}finally{_iterator14.f()}if(doBreak)return 0;// break
|
|
226
|
-
if(options.deep!==0){var result=_equals(value,second[key],_objectSpread(_objectSpread({},options),{},{deep:options.deep-1}));if(!result)return{v:false};var determineResult=function determineResult(result){var _$$result$3;return typeof result==="string"?key+((_$$result$3={"[":"",">":" "}[result[0]])!==null&&_$$result$3!==void 0?_$$result$3:".")+result:result};if(Object.prototype.hasOwnProperty.call(result,"then"))promises.push(result.then(determineResult));if(typeof result==="string")return{v:determineResult(result)}}},_ret5;for(var _i13=0,_Object$entries7=Object.entries(first);_i13<_Object$entries7.length;_i13++){_ret5=_loop5();if(_ret5===0)break;if(_ret5)return _ret5.v}}}if(promises.length)return new Promise(function(resolve){Promise.all(promises).then(function(results){var _iterator15=_createForOfIteratorHelper(results),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var result=_step15.value;if(!result||typeof result==="string"){resolve(result);break}}}catch(err){_iterator15.e(err)}finally{_iterator15.f()}resolve(true)},function(){// Do nothing.
|
|
227
|
-
})});return true}return options.returnReasonIfNotEqual?">>> ".concat(_represent(firstValue)," !== ").concat(_represent(secondValue)):false};/**
|
|
228
|
-
* Wraps given data structure into proxies recursively to evaluate and resolve
|
|
229
|
-
* each get request to data having an object with indicating keys and replaces
|
|
230
|
-
* that object with corresponding evaluated values. All nested objects are
|
|
231
|
-
* wrapped with a proxy to resolve chains of referencing expressions as well.
|
|
232
|
-
* @param object - Given mapping to resolve.
|
|
233
|
-
* @param givenOptions - Options to configure evaluation.
|
|
234
|
-
* @param givenOptions.scope - Scope to use evaluate again.
|
|
235
|
-
* @param givenOptions.selfReferenceName - Name to use for reference to given
|
|
236
|
-
* object.
|
|
237
|
-
* @param givenOptions.expressionIndicatorKey - Indicator property name to mark
|
|
238
|
-
* a value to evaluate.
|
|
239
|
-
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
240
|
-
* a value to evaluate.
|
|
241
|
-
* @returns Evaluated given mapping.
|
|
242
|
-
*/var evaluateDynamicData=function evaluateDynamicData(object,givenOptions){if(givenOptions===void 0){givenOptions={}}var options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__evaluate__",executionIndicatorKey:"__execute__"},givenOptions);if(_typeof(object)!=="object"||object===null)return object;if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=object;var internalEvaluateAndThrowError=function internalEvaluateAndThrowError(code,type){if(type===void 0){type=options.expressionIndicatorKey}return (0,_string__WEBPACK_IMPORTED_MODULE_3__.evaluateAndThrowError)(code,options.scope,type===options.executionIndicatorKey)};var _addProxyRecursively=function addProxyRecursively(data){if(_typeof(data)!=="object"||data===null||typeof Proxy==="undefined")return data;for(var _i14=0,_Object$entries8=Object.entries(data);_i14<_Object$entries8.length;_i14++){var _Object$entries8$_i=_slicedToArray(_Object$entries8[_i14],2),key=_Object$entries8$_i[0],givenValue=_Object$entries8$_i[1];if(key!=="__target__"&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
243
|
-
if(Object.prototype.hasOwnProperty.call(value,options.expressionIndicatorKey)||Object.prototype.hasOwnProperty.call(value,options.executionIndicatorKey)){var backup=value;data[key]=new Proxy(value,{get:function get(target,key){if(key==="__target__")return target;if(key==="hasOwnProperty")return target[key];/*
|
|
244
|
-
NOTE: Very complicated section, do only
|
|
245
|
-
changes while having good tests.
|
|
246
|
-
*/for(var _i15=0,_arr6=[options.expressionIndicatorKey,options.executionIndicatorKey];_i15<_arr6.length;_i15++){var type=_arr6[_i15];if(key===type&&typeof target[key]==="string")return _resolve(internalEvaluateAndThrowError(target[key],type))}var resolvedTarget=_resolve(target);if(key==="toString"){var result=internalEvaluateAndThrowError(resolvedTarget);return result[key].bind(result)}if(typeof key!=="string"){var _result$key;var _result=internalEvaluateAndThrowError(resolvedTarget);if((_result$key=_result[key])!==null&&_result$key!==void 0&&_result$key.bind)return _result[key].bind(_result);return _result[key]}for(var _i16=0,_arr7=[options.expressionIndicatorKey,options.executionIndicatorKey];_i16<_arr7.length;_i16++){var _type=_arr7[_i16];if(Object.prototype.hasOwnProperty.call(target,_type))return internalEvaluateAndThrowError(resolvedTarget,_type)[key]}return resolvedTarget[key];// End of complicated stuff.
|
|
247
|
-
},ownKeys:function ownKeys(target){for(var _i17=0,_arr8=[options.expressionIndicatorKey,options.executionIndicatorKey];_i17<_arr8.length;_i17++){var type=_arr8[_i17];if(Object.prototype.hasOwnProperty.call(target,type))return Object.getOwnPropertyNames(_resolve(internalEvaluateAndThrowError(target[type],type)))}return Object.getOwnPropertyNames(target)}});/*
|
|
248
|
-
NOTE: Known proxy polyfills does not provide the
|
|
249
|
-
"__target__" api.
|
|
250
|
-
*/if(!data[key].__target__)data[key].__target__=backup}}}return data};var _resolve=function resolve(data){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(data)){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isProxy)(data)){// NOTE: We have to skip "ownKeys" proxy trap here.
|
|
251
|
-
for(var _i18=0,_arr9=[options.expressionIndicatorKey,options.executionIndicatorKey];_i18<_arr9.length;_i18++){var type=_arr9[_i18];if(Object.prototype.hasOwnProperty.call(data,type))return data[type]}data=data.__target__}for(var _i19=0,_Object$entries9=Object.entries(data);_i19<_Object$entries9.length;_i19++){var _Object$entries9$_i=_slicedToArray(_Object$entries9[_i19],2),key=_Object$entries9$_i[0],value=_Object$entries9$_i[1];if([options.expressionIndicatorKey,options.executionIndicatorKey].includes(key)){if(typeof Proxy==="undefined")return _resolve(internalEvaluateAndThrowError(value));return value}data[key]=_resolve(value)}}return data};options.scope.resolve=_resolve;var _removeProxyRecursively=function removeProxyRecursively(data){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(data))for(var _i20=0,_Object$entries0=Object.entries(data);_i20<_Object$entries0.length;_i20++){var _Object$entries0$_i=_slicedToArray(_Object$entries0[_i20],2),key=_Object$entries0$_i[0],value=_Object$entries0$_i[1];if(key!=="__target__"&&value!==null&&["function","undefined"].includes(_typeof(value))){var target=value.__target__;if(typeof target!=="undefined")data[key]=target;_removeProxyRecursively(value)}}return data};if(Object.prototype.hasOwnProperty.call(object,options.expressionIndicatorKey))return internalEvaluateAndThrowError(object[options.expressionIndicatorKey]);else if(Object.prototype.hasOwnProperty.call(object,options.executionIndicatorKey))return internalEvaluateAndThrowError(object[options.executionIndicatorKey],options.executionIndicatorKey);return _removeProxyRecursively(_resolve(_addProxyRecursively(object)))};/**
|
|
252
|
-
* Searches for indicating keys and replaces that data with corresponding
|
|
253
|
-
* evaluated and promise resolved value.
|
|
254
|
-
* @param data - Given mapping to resolve.
|
|
255
|
-
* @param givenOptions - Options to configure evaluation.
|
|
256
|
-
* @param givenOptions.scope - Scope to use evaluate again.
|
|
257
|
-
* @param givenOptions.selfReferenceName - Name to use for reference to given
|
|
258
|
-
* object.
|
|
259
|
-
* @param givenOptions.expressionIndicatorKey - Indicator property name to mark
|
|
260
|
-
* a value to evaluate.
|
|
261
|
-
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
262
|
-
* a value to evaluate.
|
|
263
|
-
* @returns Evaluated given mapping.
|
|
264
|
-
*/var _evaluateAsyncDynamicData=/*#__PURE__*/function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,_i21,_Object$entries1,_Object$entries1$_i,key,value;return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if(!(_typeof(data)!=="object"||data===null)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;_i21=0,_Object$entries1=Object.entries(data);case 2:if(!(_i21<_Object$entries1.length)){_context.n=6;break}_Object$entries1$_i=_slicedToArray(_Object$entries1[_i21],2),key=_Object$entries1$_i[0],value=_Object$entries1$_i[1];if(![options.expressionIndicatorKey,options.executionIndicatorKey].includes(key)){_context.n=4;break}_context.n=3;return (0,_string__WEBPACK_IMPORTED_MODULE_3__.evaluateAndThrowError)(value,options.scope,key===options.executionIndicatorKey);case 3:result[key]=_context.v;_context.n=5;break;case 4:if(!(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value)){_context.n=5;break}_context.n=5;return _evaluateAsyncDynamicData(value,options);case 5:_i21++;_context.n=2;break;case 6:return _context.a(2,result)}},_callee)}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}();/**
|
|
265
|
-
* Removes properties in objects where a dynamic indicator lives.
|
|
266
|
-
* @param data - Object to traverse recursively.
|
|
267
|
-
* @param expressionIndicators - Property key to remove.
|
|
268
|
-
* @returns Given object with removed properties.
|
|
269
|
-
*/var _removeKeysInEvaluation=function removeKeysInEvaluation(data,expressionIndicators){if(expressionIndicators===void 0){expressionIndicators=["__evaluate__","__execute__"]}for(var _i22=0,_Object$entries10=Object.entries(data);_i22<_Object$entries10.length;_i22++){var _Object$entries10$_i=_slicedToArray(_Object$entries10[_i22],2),key=_Object$entries10$_i[0],value=_Object$entries10$_i[1];if(!expressionIndicators.includes(key)&&expressionIndicators.some(function(name){return Object.prototype.hasOwnProperty.call(data,name)}))delete data[key];else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value))_removeKeysInEvaluation(value,expressionIndicators)}return data};/**
|
|
270
|
-
* Extends given target object with given sources object. As target and
|
|
271
|
-
* sources many expandable types are allowed but target and sources have to
|
|
272
|
-
* come from the same type.
|
|
273
|
-
* @param targetOrDeepIndicator - Maybe the target or deep indicator.
|
|
274
|
-
* @param targetOrSource - Target or source object; depending on first
|
|
275
|
-
* argument.
|
|
276
|
-
* @param additionalSources - Source objects to extend into target.
|
|
277
|
-
* @returns Returns given target extended with all given sources.
|
|
278
|
-
*/var _extend=function extend(targetOrDeepIndicator,targetOrSource){var deep=false;for(var _len=arguments.length,additionalSources=new Array(_len>2?_len-2:0),_key5=2;_key5<_len;_key5++){additionalSources[_key5-2]=arguments[_key5]}var sources=additionalSources;var target;if(targetOrDeepIndicator===_constants__WEBPACK_IMPORTED_MODULE_0__.IGNORE_NULL_AND_UNDEFINED_SYMBOL||typeof targetOrDeepIndicator==="boolean"){// Handle a deep copy situation and skip deep indicator and target.
|
|
279
|
-
deep=targetOrDeepIndicator;target=targetOrSource}else{target=targetOrDeepIndicator;if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(targetOrSource))sources=[targetOrSource].concat(_toConsumableArray(sources));else if(targetOrSource!==undefined)target=targetOrSource}var mergeValue=function mergeValue(targetValue,value){if(value===targetValue)return targetValue;// Traverse recursively if we're merging plain objects or maps.
|
|
280
|
-
if(deep&&value&&((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value)||(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(value))){var clone;if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(value))clone=targetValue&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(targetValue)?targetValue:new Map;else clone=targetValue&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(targetValue)?targetValue:{};return _extend(deep,clone,value)}return value};var _iterator16=_createForOfIteratorHelper(sources),_step16;try{for(_iterator16.s();!(_step16=_iterator16.n()).done;){var source=_step16.value;var targetType=_typeof(target);var sourceType=_typeof(source);if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(target))targetType+=" Map";if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(source))sourceType+=" Map";if(targetType===sourceType&&target!==source){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(target)&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(source)){var _iterator17=_createForOfIteratorHelper(source),_step17;try{for(_iterator17.s();!(_step17=_iterator17.n()).done;){var _step17$value=_slicedToArray(_step17.value,2),key=_step17$value[0],value=_step17$value[1];target.set(key,mergeValue(target.get(key),value))}}catch(err){_iterator17.e(err)}finally{_iterator17.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(target)&&!Array.isArray(target)&&!(typeof Blob!=="undefined"&&target instanceof Blob)&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(source)&&!Array.isArray(source)&&!(typeof Blob!=="undefined"&&source instanceof Blob)){for(var _i23=0,_Object$entries11=Object.entries(source);_i23<_Object$entries11.length;_i23++){var _Object$entries11$_i=_slicedToArray(_Object$entries11[_i23],2),_key6=_Object$entries11$_i[0],_value13=_Object$entries11$_i[1];if(!(deep===_constants__WEBPACK_IMPORTED_MODULE_0__.IGNORE_NULL_AND_UNDEFINED_SYMBOL&&[null,undefined].includes(_value13)))target[_key6]=mergeValue(target[_key6],_value13)}}else target=source;}else target=source}}catch(err){_iterator16.e(err)}finally{_iterator16.f()}return target};/**
|
|
281
|
-
* Generates a proxy handler which forwards all operations to given object
|
|
282
|
-
* as there wouldn't be a proxy.
|
|
283
|
-
* @param target - Object to proxy.
|
|
284
|
-
* @param methodNames - Mapping of operand name to object specific method
|
|
285
|
-
* name.
|
|
286
|
-
* @returns Determined proxy handler.
|
|
287
|
-
*/var getProxyHandler=function getProxyHandler(target,methodNames){if(methodNames===void 0){methodNames={}}methodNames=_objectSpread({delete:"[]",get:"[]",has:"[]",set:"[]"},methodNames);return{deleteProperty:function deleteProperty(_targetObject,key){if(methodNames.delete==="[]"&&typeof key==="string")delete target[key];else return target[methodNames.delete](key);return true},get:function get(_targetObject,key){if(methodNames.get==="[]"&&typeof key==="string")return target[key];return target[methodNames.get](key)},has:function has(_targetObject,key){if(methodNames.has==="[]")return key in target;return target[methodNames.has](key)},set:function set(_targetObject,key,value){if(methodNames.set==="[]"&&typeof key==="string")target[key]=value;else return target[methodNames.set](key,value);return true}}};/**
|
|
288
|
-
* Slices all properties from given object which does not match provided
|
|
289
|
-
* object mask. Items can be explicitly whitelisted via "include" mask
|
|
290
|
-
* configuration or black listed via "exclude" mask configuration.
|
|
291
|
-
* @param object - Object to slice.
|
|
292
|
-
* @param maskConfiguration - Mask configuration.
|
|
293
|
-
* @returns Given but sliced object. If (nested) object will be modified a
|
|
294
|
-
* flat copy of that object will be returned.
|
|
295
|
-
*/var _mask=function mask(object,maskConfiguration){maskConfiguration=_objectSpread({exclude:false,include:true},maskConfiguration);if(maskConfiguration.exclude===true||Array.isArray(maskConfiguration.exclude)&&maskConfiguration.exclude.length===0||maskConfiguration.include===false||_typeof(object)!=="object")return{};var exclude=Array.isArray(maskConfiguration.exclude)?maskConfiguration.exclude.reduce(function(mask,key){return _objectSpread(_objectSpread({},mask),{},_defineProperty({},key,true))},{}):maskConfiguration.exclude;var include=Array.isArray(maskConfiguration.include)?maskConfiguration.include.reduce(function(mask,key){return _objectSpread(_objectSpread({},mask),{},_defineProperty({},key,true))},{}):maskConfiguration.include;var result={};if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(include)){for(var _i24=0,_Object$entries12=Object.entries(include);_i24<_Object$entries12.length;_i24++){var _Object$entries12$_i=_slicedToArray(_Object$entries12[_i24],2),key=_Object$entries12$_i[0],value=_Object$entries12$_i[1];if(Object.prototype.hasOwnProperty.call(object,key))if(value===true)result[key]=object[key];else if(((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(value)||Array.isArray(value)&&value.length)&&_typeof(object[key])==="object")result[key]=_mask(object[key],{include:value})}}else// In this branch "mask.include === true" holds.
|
|
296
|
-
result=object;if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(exclude)){var useCopy=false;var copy=_objectSpread({},result);for(var _i25=0,_Object$entries13=Object.entries(exclude);_i25<_Object$entries13.length;_i25++){var _Object$entries13$_i=_slicedToArray(_Object$entries13[_i25],2),_key7=_Object$entries13$_i[0],_value14=_Object$entries13$_i[1];if(Object.prototype.hasOwnProperty.call(copy,_key7))if(_value14===true){useCopy=true;delete copy[_key7]}else if(((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(_value14)||Array.isArray(_value14)&&_value14.length)&&_typeof(copy[_key7])==="object"){var current=copy[_key7];copy[_key7]=_mask(copy[_key7],{exclude:_value14});if(copy[_key7]!==current)useCopy=true}}if(useCopy)result=copy}return result};/**
|
|
297
|
-
* Modifies given target corresponding to given source and removes source
|
|
298
|
-
* modification infos.
|
|
299
|
-
* @param target - Object to modify.
|
|
300
|
-
* @param source - Source object to load modifications from.
|
|
301
|
-
* @param removeIndicatorKey - Indicator property name or value to mark a
|
|
302
|
-
* value to remove from object or list.
|
|
303
|
-
* @param prependIndicatorKey - Indicator property name to mark a value to
|
|
304
|
-
* prepend to target list.
|
|
305
|
-
* @param appendIndicatorKey - Indicator property name to mark a value to
|
|
306
|
-
* append to target list.
|
|
307
|
-
* @param positionPrefix - Indicates a prefix to use a value on given
|
|
308
|
-
* position to add or remove.
|
|
309
|
-
* @param positionSuffix - Indicates a suffix to use a value on given
|
|
310
|
-
* position to add or remove.
|
|
311
|
-
* @param parentSource - Source context to remove modification info from
|
|
312
|
-
* (usually only needed internally).
|
|
313
|
-
* @param parentKey - Source key in given source context to remove
|
|
314
|
-
* modification info from (usually only needed internally).
|
|
315
|
-
* @returns Given target modified with given source.
|
|
316
|
-
*/var _modifyObject=function modifyObject(target,source,removeIndicatorKey,prependIndicatorKey,appendIndicatorKey,positionPrefix,positionSuffix,parentSource,parentKey){if(removeIndicatorKey===void 0){removeIndicatorKey="__remove__"}if(prependIndicatorKey===void 0){prependIndicatorKey="__prepend__"}if(appendIndicatorKey===void 0){appendIndicatorKey="__append__"}if(positionPrefix===void 0){positionPrefix="__"}if(positionSuffix===void 0){positionSuffix="__"}if(parentSource===void 0){parentSource=null}if(parentKey===void 0){parentKey=null}if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(source)&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(target)){var _iterator18=_createForOfIteratorHelper(source),_step18;try{for(_iterator18.s();!(_step18=_iterator18.n()).done;){var _step18$value=_slicedToArray(_step18.value,2),key=_step18$value[0],value=_step18$value[1];if(target.has(key))_modifyObject(target.get(key),value,removeIndicatorKey,prependIndicatorKey,appendIndicatorKey,positionPrefix,positionSuffix,source,key)}}catch(err){_iterator18.e(err)}finally{_iterator18.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(source)&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(target))for(var _i26=0,_Object$entries14=Object.entries(source);_i26<_Object$entries14.length;_i26++){var _Object$entries14$_i=_slicedToArray(_Object$entries14[_i26],2),_key8=_Object$entries14$_i[0],sourceValue=_Object$entries14$_i[1];var index=NaN;if(Array.isArray(target)&&_key8.startsWith(positionPrefix)&&_key8.endsWith(positionSuffix)){index=parseInt(_key8.substring(positionPrefix.length,_key8.length-positionSuffix.length),10);if(index<0||index>=target.length)index=NaN}if([removeIndicatorKey,prependIndicatorKey,appendIndicatorKey].includes(_key8)||!isNaN(index)){if(Array.isArray(target)){if(_key8===removeIndicatorKey){var values=[].concat(sourceValue);var _iterator19=_createForOfIteratorHelper(values),_step19;try{for(_iterator19.s();!(_step19=_iterator19.n()).done;){var _value15=_step19.value;if(typeof _value15==="string"&&_value15.startsWith(positionPrefix)&&_value15.endsWith(positionSuffix))target.splice(parseInt(_value15.substring(positionPrefix.length,_value15.length-positionSuffix.length),10),1);else if(target.includes(_value15))target.splice(target.indexOf(_value15),1);else if(typeof _value15==="number"&&_value15<target.length)target.splice(_value15,1)}}catch(err){_iterator19.e(err)}finally{_iterator19.f()}}else if(_key8===appendIndicatorKey)target=target.concat(sourceValue);else if(_key8===prependIndicatorKey)target=[].concat(sourceValue).concat(target);else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(target[index])&&(0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(sourceValue))_extend(true,_modifyObject(target[index],sourceValue,removeIndicatorKey,prependIndicatorKey,appendIndicatorKey,positionPrefix,positionSuffix),target[index],sourceValue);else target[index]=sourceValue;}else if(_key8===removeIndicatorKey){var _iterator20=_createForOfIteratorHelper([].concat(sourceValue)),_step20;try{for(_iterator20.s();!(_step20=_iterator20.n()).done;){var _value16=_step20.value;if(typeof _value16==="string"&&Object.prototype.hasOwnProperty.call(target,_value16))delete target[_value16]}}catch(err){_iterator20.e(err)}finally{_iterator20.f()}}delete source[_key8];if(parentSource&&typeof parentKey==="string")delete parentSource[parentKey]}else if(target!==null&&Object.prototype.hasOwnProperty.call(target,_key8))target[_key8]=_modifyObject(target[_key8],sourceValue,removeIndicatorKey,prependIndicatorKey,appendIndicatorKey,positionPrefix,positionSuffix,source,_key8)}return target};/**
|
|
317
|
-
* Removes given key from given object recursively.
|
|
318
|
-
* @param object - Object to process.
|
|
319
|
-
* @param keys - List of keys to remove.
|
|
320
|
-
* @returns Processed given object.
|
|
321
|
-
*/var _removeKeyPrefixes=function removeKeyPrefixes(object,keys){if(keys===void 0){keys="#"}var resolvedKeys=[].concat(keys);if(Array.isArray(object)){var index=0;var _iterator21=_createForOfIteratorHelper(object.slice()),_step21;try{for(_iterator21.s();!(_step21=_iterator21.n()).done;){var subObject=_step21.value;var skip=false;if(typeof subObject==="string"){var _iterator22=_createForOfIteratorHelper(resolvedKeys),_step22;try{for(_iterator22.s();!(_step22=_iterator22.n()).done;){var key=_step22.value;if(subObject.startsWith("".concat(key,":"))){object.splice(index,1);skip=true;break}}}catch(err){_iterator22.e(err)}finally{_iterator22.f()}if(skip)continue}object[index]=_removeKeyPrefixes(subObject,resolvedKeys);index+=1}}catch(err){_iterator21.e(err)}finally{_iterator21.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(object)){var _iterator23=_createForOfIteratorHelper(new Set(object)),_step23;try{for(_iterator23.s();!(_step23=_iterator23.n()).done;){var _subObject=_step23.value;var _skip=false;if(typeof _subObject==="string"){var _iterator24=_createForOfIteratorHelper(resolvedKeys),_step24;try{for(_iterator24.s();!(_step24=_iterator24.n()).done;){var _key9=_step24.value;if(_subObject.startsWith("".concat(_key9,":"))){object.delete(_subObject);_skip=true;break}}}catch(err){_iterator24.e(err)}finally{_iterator24.f()}if(_skip)continue}_removeKeyPrefixes(_subObject,resolvedKeys)}}catch(err){_iterator23.e(err)}finally{_iterator23.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var _iterator25=_createForOfIteratorHelper(new Map(object)),_step25;try{for(_iterator25.s();!(_step25=_iterator25.n()).done;){var _step25$value=_slicedToArray(_step25.value,2),_key0=_step25$value[0],_subObject2=_step25$value[1];var _skip2=false;if(typeof _key0==="string"){var _iterator26=_createForOfIteratorHelper(resolvedKeys),_step26;try{for(_iterator26.s();!(_step26=_iterator26.n()).done;){var resolvedKey=_step26.value;var escapedKey=(0,_string__WEBPACK_IMPORTED_MODULE_3__.escapeRegularExpressions)(resolvedKey);if(new RegExp("^".concat(escapedKey,"[0-9]*$")).test(_key0)){object.delete(_key0);_skip2=true;break}}}catch(err){_iterator26.e(err)}finally{_iterator26.f()}if(_skip2)continue}object.set(_key0,_removeKeyPrefixes(_subObject2,resolvedKeys))}}catch(err){_iterator25.e(err)}finally{_iterator25.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(object))for(var _i27=0,_Object$entries15=Object.entries(Object.assign({},object));_i27<_Object$entries15.length;_i27++){var _Object$entries15$_i=_slicedToArray(_Object$entries15[_i27],2),_key1=_Object$entries15$_i[0],value=_Object$entries15$_i[1];var _skip3=false;var _iterator27=_createForOfIteratorHelper(resolvedKeys),_step27;try{for(_iterator27.s();!(_step27=_iterator27.n()).done;){var _resolvedKey=_step27.value;var _escapedKey=(0,_string__WEBPACK_IMPORTED_MODULE_3__.escapeRegularExpressions)(_resolvedKey);if(new RegExp("^".concat(_escapedKey,"[0-9]*$")).test(_key1)){delete object[_key1];_skip3=true;break}}}catch(err){_iterator27.e(err)}finally{_iterator27.f()}if(_skip3)continue;object[_key1]=_removeKeyPrefixes(value,resolvedKeys)}return object};/**
|
|
322
|
-
* Represents given object as formatted string.
|
|
323
|
-
* @param object - Object to represent.
|
|
324
|
-
* @param maximumLengthOfLists - Maximum number of array item to render.
|
|
325
|
-
* @param indention - String (usually whitespaces) to use as indention.
|
|
326
|
-
* @param initialIndention - String (usually whitespaces) to use as
|
|
327
|
-
* additional indention for the first object traversing level.
|
|
328
|
-
* @param maximumNumberOfLevelsReachedIdentifier - Replacement for objects
|
|
329
|
-
* which are out of specified bounds to traverse.
|
|
330
|
-
* @param numberOfLevels - Specifies number of levels to traverse given
|
|
331
|
-
* data structure.
|
|
332
|
-
* @returns Representation string.
|
|
333
|
-
*/var _represent=function represent(object,maximumLengthOfLists,indention,initialIndention,maximumNumberOfLevelsReachedIdentifier,numberOfLevels){if(maximumLengthOfLists===void 0){maximumLengthOfLists=30}if(indention===void 0){indention=" "}if(initialIndention===void 0){initialIndention=""}if(maximumNumberOfLevelsReachedIdentifier===void 0){maximumNumberOfLevelsReachedIdentifier="__maximum_number_of_levels_reached__"}if(numberOfLevels===void 0){numberOfLevels=8}if(numberOfLevels===0)return String(maximumNumberOfLevelsReachedIdentifier);if(object===null)return"null";if(object===undefined)return"undefined";if(typeof object==="string")return"\"".concat(object.replace(/\n/g,"\n".concat(initialIndention)),"\"");if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isNumeric)(object)||typeof object==="boolean")return String(object);if(object instanceof Date)return object.toISOString();if(Array.isArray(object)){var _result2="[";var _firstSeen=false;var _counter=1;var _iterator28=_createForOfIteratorHelper(object),_step28;try{for(_iterator28.s();!(_step28=_iterator28.n()).done;){var item=_step28.value;if(_counter>maximumLengthOfLists){_result2+="\n".concat(initialIndention,"...");break}if(_firstSeen)_result2+=",";_result2+="\n".concat(initialIndention).concat(indention)+_represent(item,maximumLengthOfLists,indention,"".concat(initialIndention).concat(indention),maximumNumberOfLevelsReachedIdentifier,numberOfLevels-1);_firstSeen=true;_counter+=1}}catch(err){_iterator28.e(err)}finally{_iterator28.f()}if(_firstSeen)_result2+="\n".concat(initialIndention);_result2+="]";return _result2}if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var _result3="";var _firstSeen2=false;var _counter2=1;var _iterator29=_createForOfIteratorHelper(object),_step29;try{for(_iterator29.s();!(_step29=_iterator29.n()).done;){var _step29$value=_slicedToArray(_step29.value,2),key=_step29$value[0],_item=_step29$value[1];if(_counter2>maximumLengthOfLists){_result3+=",\n".concat(initialIndention,"...");break}if(_firstSeen2)_result3+=",\n".concat(initialIndention).concat(indention);_result3+=_represent(key,maximumLengthOfLists,indention,"".concat(initialIndention).concat(indention),maximumNumberOfLevelsReachedIdentifier,numberOfLevels-1)+" -> "+_represent(_item,maximumLengthOfLists,indention,"".concat(initialIndention).concat(indention),maximumNumberOfLevelsReachedIdentifier,numberOfLevels-1);_firstSeen2=true;_counter2+=1}}catch(err){_iterator29.e(err)}finally{_iterator29.f()}if(!_firstSeen2)_result3="EmptyMap";return _result3}if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(object)){var _result4="{";var _firstSeen3=false;var _counter3=1;var _iterator30=_createForOfIteratorHelper(object),_step30;try{for(_iterator30.s();!(_step30=_iterator30.n()).done;){var _item2=_step30.value;if(_counter3>maximumLengthOfLists){_result4+=",\n".concat(initialIndention,"...");break}if(_firstSeen3)_result4+=",";_result4+="\n".concat(initialIndention).concat(indention)+_represent(_item2,maximumLengthOfLists,indention,"".concat(initialIndention).concat(indention),maximumNumberOfLevelsReachedIdentifier,numberOfLevels-1);_firstSeen3=true;_counter3+=1}}catch(err){_iterator30.e(err)}finally{_iterator30.f()}if(_firstSeen3)_result4+="\n".concat(initialIndention,"}");else _result4="EmptySet";return _result4}if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isFunction)(object))return"__function__";var result="{";var keys=Object.getOwnPropertyNames(object).sort();var firstSeen=false;var counter=1;var _iterator31=_createForOfIteratorHelper(keys),_step31;try{for(_iterator31.s();!(_step31=_iterator31.n()).done;){var _key10=_step31.value;if(counter>maximumLengthOfLists){result+=",\n".concat(initialIndention,"...");break}if(firstSeen)result+=",";result+="\n".concat(initialIndention).concat(indention).concat(_key10,": ")+_represent(object[_key10],maximumLengthOfLists,indention,"".concat(initialIndention).concat(indention),maximumNumberOfLevelsReachedIdentifier,numberOfLevels-1);firstSeen=true;counter+=1}}catch(err){_iterator31.e(err)}finally{_iterator31.f()}if(firstSeen)result+="\n".concat(initialIndention);result+="}";return result};/**
|
|
334
|
-
* Sort given objects keys.
|
|
335
|
-
* @param object - Object which keys should be sorted.
|
|
336
|
-
* @returns Sorted list of given keys.
|
|
337
|
-
*/var sort=function sort(object){var keys=[];if(Array.isArray(object))for(var index=0;index<object.length;index++)keys.push(index);else if(_typeof(object)==="object")if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var _iterator32=_createForOfIteratorHelper(object),_step32;try{for(_iterator32.s();!(_step32=_iterator32.n()).done;){var keyValuePair=_step32.value;keys.push(keyValuePair[0])}}catch(err){_iterator32.e(err)}finally{_iterator32.f()}}else if(object!==null)for(var _i28=0,_Object$keys=Object.keys(object);_i28<_Object$keys.length;_i28++){var key=_Object$keys[_i28];keys.push(key)}return keys.sort()};/**
|
|
338
|
-
* Removes a proxy from given data structure recursively.
|
|
339
|
-
* @param object - Object to proxy.
|
|
340
|
-
* @param seenObjects - Tracks all already processed objects to avoid
|
|
341
|
-
* endless loops (usually only needed for internal purpose).
|
|
342
|
-
* @returns Returns given object unwrapped from a dynamic proxy.
|
|
343
|
-
*/var _unwrapProxy=function unwrapProxy(object,seenObjects){if(seenObjects===void 0){seenObjects=new Set}if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isObject)(object)){if(seenObjects.has(object))return object;try{if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isFunction)(object.__revoke__)){if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isProxy)(object))object=object.__target__;object.__revoke__()}}catch(_unused){return object}finally{seenObjects.add(object)}if(Array.isArray(object)){var index=0;var _iterator33=_createForOfIteratorHelper(object),_step33;try{for(_iterator33.s();!(_step33=_iterator33.n()).done;){var value=_step33.value;object[index]=_unwrapProxy(value,seenObjects);index+=1}}catch(err){_iterator33.e(err)}finally{_iterator33.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isMap)(object)){var _iterator34=_createForOfIteratorHelper(object),_step34;try{for(_iterator34.s();!(_step34=_iterator34.n()).done;){var _step34$value=_slicedToArray(_step34.value,2),key=_step34$value[0],_value17=_step34$value[1];object.set(key,_unwrapProxy(_value17,seenObjects))}}catch(err){_iterator34.e(err)}finally{_iterator34.f()}}else if((0,_indicators__WEBPACK_IMPORTED_MODULE_1__.isSet)(object)){var cache=[];var _iterator35=_createForOfIteratorHelper(object),_step35;try{for(_iterator35.s();!(_step35=_iterator35.n()).done;){var _value19=_step35.value;object.delete(_value19);cache.push(_unwrapProxy(_value19,seenObjects))}}catch(err){_iterator35.e(err)}finally{_iterator35.f()}for(var _i29=0,_cache4=cache;_i29<_cache4.length;_i29++){var _value18=_cache4[_i29];object.add(_value18)}}else for(var _i30=0,_Object$entries16=Object.entries(object);_i30<_Object$entries16.length;_i30++){var _Object$entries16$_i=_slicedToArray(_Object$entries16[_i30],2),_key11=_Object$entries16$_i[0],_value20=_Object$entries16$_i[1];object[_key11]=_unwrapProxy(_value20,seenObjects)}}return object};
|
|
344
|
-
|
|
345
|
-
/***/ }),
|
|
346
|
-
/* 3 */
|
|
347
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
348
|
-
|
|
349
|
-
"use strict";
|
|
350
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
351
|
-
/* harmony export */ isFunction: function() { return /* binding */ isFunction; },
|
|
352
|
-
/* harmony export */ isMap: function() { return /* binding */ isMap; },
|
|
353
|
-
/* harmony export */ isNumeric: function() { return /* binding */ isNumeric; },
|
|
354
|
-
/* harmony export */ isObject: function() { return /* binding */ isObject; },
|
|
355
|
-
/* harmony export */ isPlainObject: function() { return /* binding */ isPlainObject; },
|
|
356
|
-
/* harmony export */ isProxy: function() { return /* binding */ isProxy; },
|
|
357
|
-
/* harmony export */ isSet: function() { return /* binding */ isSet; }
|
|
358
|
-
/* harmony export */ });
|
|
359
|
-
/* unused harmony exports isWindow, isArrayLike, isAnyMatching */
|
|
360
|
-
/* unused harmony import specifier */ var determineType;
|
|
361
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
362
|
-
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2);
|
|
363
|
-
// #!/usr/bin/env babel-node
|
|
364
|
-
// -*- coding: utf-8 -*-
|
|
365
|
-
/** @module indicators *//* !
|
|
366
|
-
region header
|
|
367
|
-
[Project page](https://torben.website/clientnode)
|
|
368
|
-
|
|
369
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
370
|
-
|
|
371
|
-
License
|
|
372
|
-
-------
|
|
373
|
-
|
|
374
|
-
This library written by Torben Sickert stands under a creative commons
|
|
375
|
-
naming 3.0 unported license.
|
|
376
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
377
|
-
endregion
|
|
378
|
-
*/function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}/**
|
|
379
|
-
* Determines whether its argument represents a JavaScript number.
|
|
380
|
-
* @param value - Value to analyze.
|
|
381
|
-
* @returns A boolean value indicating whether given object is numeric
|
|
382
|
-
* like.
|
|
383
|
-
*/var isNumeric=function isNumeric(value){var type=(0,_object__WEBPACK_IMPORTED_MODULE_1__.determineType)(value);/*
|
|
384
|
-
NOTE: "parseFloat" "NaNs" numeric-cast false positives ("") but
|
|
385
|
-
misinterprets leading-number strings, particularly hex literals
|
|
386
|
-
("0x...") subtraction forces infinities to NaN.
|
|
387
|
-
*/return["number","string"].includes(type)&&!isNaN(value-parseFloat(value))};/**
|
|
388
|
-
* Determine whether the argument is a window.
|
|
389
|
-
* @param value - Value to check for.
|
|
390
|
-
* @returns Boolean value indicating the result.
|
|
391
|
-
*/var isWindow=function isWindow(value){return![null,undefined].includes(value)&&_typeof(value)==="object"&&value===(value===null||value===void 0?void 0:value.window)};/**
|
|
392
|
-
* Checks if given object is similar to an array and can be handled like an
|
|
393
|
-
* array.
|
|
394
|
-
* @param object - Object to check behavior for.
|
|
395
|
-
* @returns A boolean value indicating whether given object is array like.
|
|
396
|
-
*/var isArrayLike=function isArrayLike(object){var length;try{length=Boolean(object)&&object.length}catch(_unused){return false}var type=determineType(object);if(type==="function"||isWindow(object))return false;if(type==="array"||length===0)return true;if(typeof length==="number"&&length>0)try{var _dump=object[length-1];return true}catch(_unused2){// Continue regardless of an error.
|
|
397
|
-
}return false};/**
|
|
398
|
-
* Checks whether one of the given pattern matches given string.
|
|
399
|
-
* @param target - Target to check in pattern for.
|
|
400
|
-
* @param pattern - List of pattern to check for.
|
|
401
|
-
* @returns Value "true" if given object is matches by at leas one of the
|
|
402
|
-
* given pattern and "false" otherwise.
|
|
403
|
-
*/var isAnyMatching=function isAnyMatching(target,pattern){var _iterator=_createForOfIteratorHelper(pattern),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var currentPattern=_step.value;if(typeof currentPattern==="string"){if(currentPattern===target)return true}else if(currentPattern.test(target))return true}}catch(err){_iterator.e(err)}finally{_iterator.f()}return false};/**
|
|
404
|
-
* Checks whether given object is a native object but not null.
|
|
405
|
-
* @param value - Value to check.
|
|
406
|
-
* @returns Value "true" if given object is a plain javaScript object and
|
|
407
|
-
* "false" otherwise.
|
|
408
|
-
*/var isObject=function isObject(value){return value!==null&&_typeof(value)==="object"};/**
|
|
409
|
-
* Checks whether given object is a plain native object.
|
|
410
|
-
* @param value - Value to check.
|
|
411
|
-
* @returns Value "true" if given object is a plain javaScript object and
|
|
412
|
-
* "false" otherwise.
|
|
413
|
-
*/var isPlainObject=function isPlainObject(value){return isObject(value)&&_constants__WEBPACK_IMPORTED_MODULE_0__.PLAIN_OBJECT_PROTOTYPES.includes(Object.getPrototypeOf(value))};/**
|
|
414
|
-
* Checks whether given object is a set.
|
|
415
|
-
* @param value - Value to check.
|
|
416
|
-
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
417
|
-
*/var isSet=function isSet(value){return (0,_object__WEBPACK_IMPORTED_MODULE_1__.determineType)(value)==="set"};/**
|
|
418
|
-
* Checks whether given object is a map.
|
|
419
|
-
* @param value - Value to check.
|
|
420
|
-
* @returns Value "true" if given object is a map and "false" otherwise.
|
|
421
|
-
*/var isMap=function isMap(value){return (0,_object__WEBPACK_IMPORTED_MODULE_1__.determineType)(value)==="map"};/**
|
|
422
|
-
* Checks whether given object is a proxy.
|
|
423
|
-
* @param value - Value to check.
|
|
424
|
-
* @returns Value "true" if given object is a proxy and "false" otherwise.
|
|
425
|
-
*/var isProxy=function isProxy(value){return Boolean(value.__target__)};/**
|
|
426
|
-
* Checks whether given object is a function.
|
|
427
|
-
* @param value - Value to check.
|
|
428
|
-
* @returns Value "true" if given object is a function and "false"
|
|
429
|
-
* otherwise.
|
|
430
|
-
*/var isFunction=function isFunction(value){return Boolean(value)&&["[object AsyncFunction]","[object Function]"].includes({}.toString.call(value))};
|
|
431
|
-
|
|
432
|
-
/***/ }),
|
|
433
|
-
/* 4 */
|
|
434
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
435
|
-
|
|
436
|
-
"use strict";
|
|
437
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
438
|
-
/* harmony export */ globalContext: function() { return /* binding */ globalContext; }
|
|
439
|
-
/* harmony export */ });
|
|
440
|
-
/* unused harmony exports setGlobalContext, MAXIMAL_NUMBER_OF_ITERATIONS, NOOP, mockConsole */
|
|
441
|
-
/* unused harmony import specifier */ var CONSOLE_METHODS;
|
|
442
|
-
/* harmony import */ var _module__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
443
|
-
// #!/usr/bin/env babel-node
|
|
444
|
-
// -*- coding: utf-8 -*-
|
|
445
|
-
/** @module context *//* !
|
|
446
|
-
region header
|
|
447
|
-
[Project page](https://torben.website/clientnode)
|
|
448
|
-
|
|
449
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
450
|
-
|
|
451
|
-
License
|
|
452
|
-
-------
|
|
453
|
-
|
|
454
|
-
This library written by Torben Sickert stands under a creative commons
|
|
455
|
-
naming 3.0 unported license.
|
|
456
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
457
|
-
endregion
|
|
458
|
-
*/var _optionalRequire$defa,_optionalRequire;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var globalContext=(0,_module__WEBPACK_IMPORTED_MODULE_0__.determineGlobalContext)();var setGlobalContext=function setGlobalContext(context){globalContext=context};globalContext.fetch=globalContext.fetch?globalContext.fetch.bind(globalContext):(_optionalRequire$defa=(_optionalRequire=(0,_module__WEBPACK_IMPORTED_MODULE_0__.optionalRequire)("node-fetch"))===null||_optionalRequire===void 0?void 0:_optionalRequire.default)!==null&&_optionalRequire$defa!==void 0?_optionalRequire$defa:function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}return (0,_module__WEBPACK_IMPORTED_MODULE_0__.optionalImport)(/* webpackIgnore: true */"node-fetch").then(function(module){var _ref;return(_ref=module).default.apply(_ref,parameters)})};var MAXIMAL_NUMBER_OF_ITERATIONS=(/* unused pure expression or super */ null && ({value:100}));// A no-op dummy function.
|
|
459
|
-
var NOOP=function NOOP(){// Do nothing.
|
|
460
|
-
};var mockConsole=function mockConsole(){// Avoid errors in browsers that lack a console.
|
|
461
|
-
if(!Object.prototype.hasOwnProperty.call(globalContext,"console"))globalContext.console={};if(!globalContext.console)globalContext.console={};var _iterator=_createForOfIteratorHelper(CONSOLE_METHODS),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var methodName=_step.value;if(!(methodName in globalContext.console))globalContext.console[methodName]=NOOP}}catch(err){_iterator.e(err)}finally{_iterator.f()}};
|
|
462
|
-
|
|
463
|
-
/***/ }),
|
|
464
|
-
/* 5 */
|
|
465
|
-
/***/ (function(module) {
|
|
466
|
-
|
|
467
|
-
function webpackEmptyContext(req) {
|
|
468
|
-
var e = new Error("Cannot find module '" + req + "'");
|
|
469
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
470
|
-
throw e;
|
|
471
|
-
}
|
|
472
|
-
webpackEmptyContext.keys = function() { return []; };
|
|
473
|
-
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
474
|
-
webpackEmptyContext.id = 5;
|
|
475
|
-
module.exports = webpackEmptyContext;
|
|
476
|
-
|
|
477
|
-
/***/ }),
|
|
478
|
-
/* 6 */
|
|
479
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
480
|
-
|
|
481
|
-
"use strict";
|
|
482
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
483
|
-
/* harmony export */ escapeRegularExpressions: function() { return /* binding */ escapeRegularExpressions; },
|
|
484
|
-
/* harmony export */ evaluateAndThrowError: function() { return /* binding */ evaluateAndThrowError; }
|
|
485
|
-
/* harmony export */ });
|
|
486
|
-
/* unused harmony exports POLYFILL_TEMPLATE_STRINGS, ALLOWED_VARIABLE_SYMBOLS, ALLOWED_STARTING_VARIABLE_SYMBOLS, FIX_ENCODING_ERROR_MAPPING, convertToValidVariableName, encodeURIComponentExtended, addSeparatorToPath, hasPathPrefix, getDomainName, getPortNumber, getProtocolName, getURLParameter, serviceURLEquals, normalizeURL, representURL, camelCaseToDelimited, capitalize, compressStyleValue, decodeHTMLEntities, delimitedToCamelCase, compile, evaluate, findNormalizedMatchRange, fixKnownEncodingErrors, format, getEditDistance, maskForRegularExpression, lowerCase, mark, normalizePhoneNumber, normalizeZipCode, parseEncodedObject, representPhoneNumber, sliceAllExceptNumberAndLastSeparator, normalizeDomNodeSelector, limit */
|
|
487
|
-
/* unused harmony import specifier */ var ABBREVIATIONS;
|
|
488
|
-
/* unused harmony import specifier */ var DEFAULT_ENCODING;
|
|
489
|
-
/* unused harmony import specifier */ var globalContext;
|
|
490
|
-
/* unused harmony import specifier */ var MAXIMAL_NUMBER_OF_ITERATIONS;
|
|
491
|
-
/* unused harmony import specifier */ var imports;
|
|
492
|
-
/* unused harmony import specifier */ var isFileSync;
|
|
493
|
-
/* unused harmony import specifier */ var determineType;
|
|
494
|
-
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
495
|
-
/* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
496
|
-
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2);
|
|
497
|
-
// #!/usr/bin/env babel-node
|
|
498
|
-
// -*- coding: utf-8 -*-
|
|
499
|
-
/** @module string *//* !
|
|
500
|
-
region header
|
|
501
|
-
[Project page](https://torben.website/clientnode)
|
|
502
|
-
|
|
503
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
504
|
-
|
|
505
|
-
License
|
|
506
|
-
-------
|
|
507
|
-
|
|
508
|
-
This library written by Torben Sickert stands under a creative commons
|
|
509
|
-
naming 3.0 unported license.
|
|
510
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
511
|
-
endregion
|
|
512
|
-
*/// region imports
|
|
513
|
-
function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t})()}function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}// endregion
|
|
514
|
-
var POLYFILL_TEMPLATE_STRINGS={value:false};// Partial regular expression matching symbols which should be allowed within a
|
|
515
|
-
// variable name excluding the first character.
|
|
516
|
-
var ALLOWED_VARIABLE_SYMBOLS="0-9a-zA-Z_$";// Partial regular expression matching symbols which should be allowed as
|
|
517
|
-
// starting character for a variable name.
|
|
518
|
-
var ALLOWED_STARTING_VARIABLE_SYMBOLS="a-zA-Z_$";var FIX_ENCODING_ERROR_MAPPING=(/* unused pure expression or super */ null && ([["\xC3\\x84","\xC4"],["\xC3\\x96","\xD6"],["\xC3\\x9c","\xDC"],["\xC3\xA4","\xE4"],["\xC3\xB6","\xF6"],["\xC3\xBC","\xFC"],["\\x96","-"],["\xC3\xA9","\xE9"],["\xC3\xA8","e"],["\xC3\xB4","o"],["\xC3 ","\xE1"],["\xC3\xB8","\xF8"],["\xC3\\x9f","\xDF"],["\xC3","\xDF"]]));/**
|
|
519
|
-
* Translates a given string into the regular expression validated
|
|
520
|
-
* representation.
|
|
521
|
-
* @param value - String to convert.
|
|
522
|
-
* @param excludeSymbols - Symbols not to escape.
|
|
523
|
-
* @returns Converted string.
|
|
524
|
-
*/var escapeRegularExpressions=function escapeRegularExpressions(value,excludeSymbols){if(excludeSymbols===void 0){excludeSymbols=[]}// NOTE: This is only for performance improvements.
|
|
525
|
-
if(value.length===1&&!_constants__WEBPACK_IMPORTED_MODULE_0__.SPECIAL_REGEX_SEQUENCES.includes(value))return value;// The escape sequence must also be escaped; but at first.
|
|
526
|
-
if(!excludeSymbols.includes("\\"))value.replace(/\\/g,"\\\\");var _iterator=_createForOfIteratorHelper(_constants__WEBPACK_IMPORTED_MODULE_0__.SPECIAL_REGEX_SEQUENCES),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var replace=_step.value;if(!excludeSymbols.includes(replace))value=value.replace(new RegExp("\\".concat(replace),"g"),"\\".concat(replace))}}catch(err){_iterator.e(err)}finally{_iterator.f()}return value};/**
|
|
527
|
-
* Translates a given name into a valid JavaScript one.
|
|
528
|
-
* @param name - Name to convert.
|
|
529
|
-
* @returns Converted name is returned.
|
|
530
|
-
*/var convertToValidVariableName=function convertToValidVariableName(name){if(["class","default"].includes(name))return"_".concat(name);return name// Remove all disallowed starting characters.
|
|
531
|
-
.replace(new RegExp("^[^".concat(ALLOWED_STARTING_VARIABLE_SYMBOLS,"]+")),"")// Remove all disallowed characters within a variable name and make
|
|
532
|
-
// continuing character upper case.
|
|
533
|
-
.replace(new RegExp("[^".concat(ALLOWED_VARIABLE_SYMBOLS,"]+([a-zA-Z])"),"g"),function(_fullMatch,firstLetter){return firstLetter.toUpperCase()})};// region url handline
|
|
534
|
-
/**
|
|
535
|
-
* This method is intended for encoding *key* or *value* parts of a query
|
|
536
|
-
* component. We need a custom method because "encodeURIComponent()" is too
|
|
537
|
-
* aggressive and encodes stuff that doesn't have to be encoded per
|
|
538
|
-
* "http://tools.ietf.org/html/rfc3986:".
|
|
539
|
-
* @param url - URL to encode.
|
|
540
|
-
* @param encodeSpaces - Indicates whether given url should encode
|
|
541
|
-
* whitespaces as "+" or "%20".
|
|
542
|
-
* @returns Encoded given url.
|
|
543
|
-
*/var encodeURIComponentExtended=function encodeURIComponentExtended(url,encodeSpaces){if(encodeSpaces===void 0){encodeSpaces=false}return encodeURIComponent(url).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,encodeSpaces?"%20":"+")};/**
|
|
544
|
-
* Appends a path selector to the given path if there isn't one yet.
|
|
545
|
-
* @param path - The path for appending a selector.
|
|
546
|
-
* @param pathSeparator - The selector for appending to a path.
|
|
547
|
-
* @returns The appended path.
|
|
548
|
-
*/var addSeparatorToPath=function addSeparatorToPath(path,pathSeparator){if(pathSeparator===void 0){pathSeparator="/"}path=path.trim();if(path.substring(path.length-1)!==pathSeparator&&path.length)return path+pathSeparator;return path};/**
|
|
549
|
-
* Checks if a given path has given path prefix.
|
|
550
|
-
* @param prefix - Path prefix to search for.
|
|
551
|
-
* @param path - Path to search in.
|
|
552
|
-
* @param separator - Delimiter to use in a path (default is the posix
|
|
553
|
-
* conform slash).
|
|
554
|
-
* @returns Value "true" if given prefix occurs and "false" otherwise.
|
|
555
|
-
*/var hasPathPrefix=function hasPathPrefix(prefix,path,separator){if(prefix===void 0){prefix="/admin"}if(path===void 0){var _globalContext$locati;path=((_globalContext$locati=globalContext.location)===null||_globalContext$locati===void 0?void 0:_globalContext$locati.pathname)||""}if(separator===void 0){separator="/"}if(typeof prefix==="string"){if(!prefix.endsWith(separator))prefix+=separator;return path===prefix.substring(0,prefix.length-separator.length)||path.startsWith(prefix)}return false};/**
|
|
556
|
-
* Extracts domain name from given url. If no explicit domain name given
|
|
557
|
-
* current domain name will be assumed. If no parameter is given, the current
|
|
558
|
-
* domain name will be determined.
|
|
559
|
-
* @param url - The url to extract domain from.
|
|
560
|
-
* @param fallback - The fallback host name if no one exits in given url
|
|
561
|
-
* (default is current hostname).
|
|
562
|
-
* @returns Extracted domain.
|
|
563
|
-
*/var getDomainName=function getDomainName(url,fallback){if(url===void 0){var _globalContext$locati2;url=((_globalContext$locati2=globalContext.location)===null||_globalContext$locati2===void 0?void 0:_globalContext$locati2.href)||""}if(fallback===void 0){var _globalContext$locati3;fallback=((_globalContext$locati3=globalContext.location)===null||_globalContext$locati3===void 0?void 0:_globalContext$locati3.hostname)||""}var result=/^([a-z]*:?\/\/)?([^/]+?)(?::[0-9]+)?(?:\/.*|$)/i.exec(url);if(result&&result.length>2&&result[1]&&result[2])return result[2];return fallback};/**
|
|
564
|
-
* Extracts port number from given url. If no explicit port number is given
|
|
565
|
-
* and no fallback is defined, the current port number will be assumed for local
|
|
566
|
-
* links. For external links 80 will be assumed for http protocols and 443
|
|
567
|
-
* for https protocols.
|
|
568
|
-
* @param url - The url to extract port from.
|
|
569
|
-
* @param fallback - Fallback port number if no explicit one was found.
|
|
570
|
-
* Default is derived from the current protocol name.
|
|
571
|
-
* @returns Extracted port number.
|
|
572
|
-
*/var getPortNumber=function getPortNumber(url,fallback){var _globalContext$locati6;if(url===void 0){var _globalContext$locati4;url=((_globalContext$locati4=globalContext.location)===null||_globalContext$locati4===void 0?void 0:_globalContext$locati4.href)||""}if(fallback===void 0){var _globalContext$locati5;fallback=(_globalContext$locati5=globalContext.location)!==null&&_globalContext$locati5!==void 0&&_globalContext$locati5.port?parseInt(globalContext.location.port):null}var result=/^(?:[a-z]*:?\/\/[^/]+?)?[^/]+?:([0-9]+)/i.exec(url);if(result&&result.length>1)return parseInt(result[1],10);if(fallback!==null)return fallback;if(// NOTE: Would result in an endless loop:
|
|
573
|
-
// serviceURLEquals(url, ...parameters) &&
|
|
574
|
-
(_globalContext$locati6=globalContext.location)!==null&&_globalContext$locati6!==void 0&&_globalContext$locati6.port&&parseInt(globalContext.location.port,10))return parseInt(globalContext.location.port,10);return getProtocolName(url)==="https"?443:80};/**
|
|
575
|
-
* Extracts protocol name from given url. If no explicit url is given,
|
|
576
|
-
* the current protocol will be assumed. If no parameter is given, the current
|
|
577
|
-
* protocol number will be determined.
|
|
578
|
-
* @param url - The url to extract protocol from.
|
|
579
|
-
* @param fallback - Fallback port to use if no protocol exists in given
|
|
580
|
-
* url (default is current protocol).
|
|
581
|
-
* @returns Extracted protocol.
|
|
582
|
-
*/var getProtocolName=function getProtocolName(url,fallback){if(url===void 0){var _globalContext$locati7;url=((_globalContext$locati7=globalContext.location)===null||_globalContext$locati7===void 0?void 0:_globalContext$locati7.href)||""}if(fallback===void 0){var _globalContext$locati8;fallback=((_globalContext$locati8=globalContext.location)===null||_globalContext$locati8===void 0?void 0:_globalContext$locati8.protocol)&&globalContext.location.protocol.substring(0,globalContext.location.protocol.length-1)||""}var result=/^([a-z]+):\/\//i.exec(url);if(result&&result.length>1&&result[1])return result[1];return fallback};/**
|
|
583
|
-
* Read a page's GET URL variables and return them as an associative array
|
|
584
|
-
* and preserves ordering.
|
|
585
|
-
* @param keyToGet - If provided the corresponding value for a given key is
|
|
586
|
-
* returned or full object otherwise.
|
|
587
|
-
* @param allowDuplicates - Indicates whether to return arrays of values or
|
|
588
|
-
* single values. If set to "false" (default) last values will overwrite
|
|
589
|
-
* preceding values.
|
|
590
|
-
* @param givenInput - An alternative input to the url search parameter. If
|
|
591
|
-
* "#" is given, the complete current hashtag will be interpreted as url and
|
|
592
|
-
* search parameter will be extracted from there. If "&" is given a classical
|
|
593
|
-
* search parameter, and hash parameter will be taken in an account. If a
|
|
594
|
-
* search string is given, this will be analyzed. The default is to take a
|
|
595
|
-
* given search part into account.
|
|
596
|
-
* @param subDelimiter - Defines which sequence indicates the start of
|
|
597
|
-
* parameter in a hash part of the url.
|
|
598
|
-
* @param hashedPathIndicator - If defined and given hash starts with this
|
|
599
|
-
* indicator, given hash will be interpreted as a path containing search and
|
|
600
|
-
* hash parts.
|
|
601
|
-
* @param givenSearch - Search part to take into account defaults to
|
|
602
|
-
* current url search part.
|
|
603
|
-
* @param givenHash - Hash part to take into account defaults to current
|
|
604
|
-
* url hash part.
|
|
605
|
-
* @returns Returns the current get array or requested value. If the requested
|
|
606
|
-
* key doesn't exist, "undefined" is returned.
|
|
607
|
-
*/var getURLParameter=function getURLParameter(keyToGet,allowDuplicates,givenInput,subDelimiter,hashedPathIndicator,givenSearch,givenHash){if(keyToGet===void 0){keyToGet=null}if(allowDuplicates===void 0){allowDuplicates=false}if(givenInput===void 0){givenInput=null}if(subDelimiter===void 0){subDelimiter="$"}if(hashedPathIndicator===void 0){hashedPathIndicator="!"}if(givenSearch===void 0){givenSearch=null}if(givenHash===void 0){var _globalContext$locati9,_globalContext$locati0;givenHash=(_globalContext$locati9=(_globalContext$locati0=globalContext.location)===null||_globalContext$locati0===void 0?void 0:_globalContext$locati0.hash)!==null&&_globalContext$locati9!==void 0?_globalContext$locati9:""}// region set search and hash
|
|
608
|
-
var hash=givenHash!==null&&givenHash!==void 0?givenHash:"#";var search="";if(givenSearch)search=givenSearch;else if(hashedPathIndicator&&hash.startsWith(hashedPathIndicator)){var subHashStartIndex=hash.indexOf("#");var pathAndSearch;if(subHashStartIndex===-1){pathAndSearch=hash.substring(hashedPathIndicator.length);hash=""}else{pathAndSearch=hash.substring(hashedPathIndicator.length,subHashStartIndex);hash=hash.substring(subHashStartIndex)}var subSearchStartIndex=pathAndSearch.indexOf("?");if(subSearchStartIndex!==-1)search=pathAndSearch.substring(subSearchStartIndex)}else if(globalContext.location)search=globalContext.location.search||"";var input=givenInput?givenInput:search;// endregion
|
|
609
|
-
// region determine data from search and hash if specified
|
|
610
|
-
var both=input==="&";if(both||input==="#"){var decodedHash="";try{decodedHash=decodeURIComponent(hash)}catch(_unused){// Continue regardless of an error.
|
|
611
|
-
}var subDelimiterIndex=decodedHash.indexOf(subDelimiter);if(subDelimiterIndex===-1)input="";else{input=decodedHash.substring(subDelimiterIndex);if(input.startsWith(subDelimiter))input=input.substring(subDelimiter.length)}}else if(input.startsWith("?"))input=input.substring("?".length);var data=input?input.split("&"):[];search=search.substring("?".length);if(both&&search)data=data.concat(search.split("&"));// endregion
|
|
612
|
-
// region construct data structure
|
|
613
|
-
var parameters=[];var _iterator2=_createForOfIteratorHelper(data),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _value=_step2.value;var keyValuePair=_value.split("=");var key=void 0;try{key=decodeURIComponent(keyValuePair[0])}catch(_unused2){key=""}try{_value=decodeURIComponent(keyValuePair[1])}catch(_unused3){_value=""}parameters.push(key);if(allowDuplicates){if(Object.prototype.hasOwnProperty.call(parameters,key)&&Array.isArray(parameters[key]))parameters[key].push(_value);else parameters[key]=[_value];}else parameters[key]=_value}// endregion
|
|
614
|
-
}catch(err){_iterator2.e(err)}finally{_iterator2.f()}if(keyToGet){if(Object.prototype.hasOwnProperty.call(parameters,keyToGet))return parameters[keyToGet];return null}return parameters};/**
|
|
615
|
-
* Checks if given url points to another "service" than the second given url.
|
|
616
|
-
* If no second given url is provided, the current url will be assumed.
|
|
617
|
-
* @param url - URL to check against second url.
|
|
618
|
-
* @param referenceURL - URL to check against first url.
|
|
619
|
-
* @returns Returns "true" if given first url has same domain as given
|
|
620
|
-
* second (or current).
|
|
621
|
-
*/var serviceURLEquals=function serviceURLEquals(url,referenceURL){if(referenceURL===void 0){var _globalContext$locati1;referenceURL=((_globalContext$locati1=globalContext.location)===null||_globalContext$locati1===void 0?void 0:_globalContext$locati1.href)||""}var domain=getDomainName(url,"");var protocol=getProtocolName(url,"");var port=getPortNumber(url);return(domain===""||domain===getDomainName(referenceURL))&&(protocol===""||protocol===getProtocolName(referenceURL))&&(port===null||port===getPortNumber(referenceURL))};/**
|
|
622
|
-
* Normalized given website url.
|
|
623
|
-
* @param givenURL - Uniform resource locator to normalize.
|
|
624
|
-
* @returns Normalized result.
|
|
625
|
-
*/var normalizeURL=function normalizeURL(givenURL){if(typeof givenURL==="string"){var url=givenURL.replace(/^:?\/+/,"").replace(/\/+$/,"").trim();if(url.startsWith("http"))return url;return"http://".concat(url)}return""};/**
|
|
626
|
-
* Represents given website url.
|
|
627
|
-
* @param url - Uniform resource locator to represent.
|
|
628
|
-
* @returns Represented result.
|
|
629
|
-
*/var representURL=function representURL(url){if(typeof url==="string")return url.replace(/^(https?)?:?\/+/,"").replace(/\/+$/,"").trim();return""};// endregion
|
|
630
|
-
/**
|
|
631
|
-
* Converts a camel-cased string to its delimited string version.
|
|
632
|
-
* @param value - The string to format.
|
|
633
|
-
* @param delimiter - Defines delimiter string.
|
|
634
|
-
* @param abbreviations - Collection of shortcut words to represent uppercased.
|
|
635
|
-
* @returns The formatted string.
|
|
636
|
-
*/var camelCaseToDelimited=function camelCaseToDelimited(value,delimiter,abbreviations){if(delimiter===void 0){delimiter="-"}if(abbreviations===void 0){abbreviations=null}if(!abbreviations)abbreviations=ABBREVIATIONS;var escapedDelimiter=maskForRegularExpression(delimiter);if(abbreviations.length){var abbreviationPattern="";var _iterator3=_createForOfIteratorHelper(abbreviations),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var abbreviation=_step3.value;if(abbreviationPattern)abbreviationPattern+="|";abbreviationPattern+=abbreviation.toUpperCase()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}value=value.replace(new RegExp("(".concat(abbreviationPattern,")(").concat(abbreviationPattern,")"),"g"),"$1".concat(delimiter,"$2"))}value=value.replace(new RegExp("([^".concat(escapedDelimiter,"])([A-Z][a-z]+)"),"g"),"$1".concat(delimiter,"$2"));return value.replace(new RegExp("([a-z0-9])([A-Z])","g"),"$1".concat(delimiter,"$2")).toLowerCase()};/**
|
|
637
|
-
* Converts a string to its capitalized representation.
|
|
638
|
-
* @param string - The string to format.
|
|
639
|
-
* @returns The formatted string.
|
|
640
|
-
*/var capitalize=function capitalize(string){return string.charAt(0).toUpperCase()+string.substring(1)};/**
|
|
641
|
-
* Compresses given style attribute value.
|
|
642
|
-
* @param styleValue - Style value to compress.
|
|
643
|
-
* @returns The compressed value.
|
|
644
|
-
*/var compressStyleValue=function compressStyleValue(styleValue){return styleValue.replace(/ *([:;]) */g,"$1").replace(/ +/g," ").replace(/^;+/,"").replace(/;+$/,"").trim()};/**
|
|
645
|
-
* Decodes all html symbols in text nodes in a given html string.
|
|
646
|
-
* @param htmlString - HTML string to decode.
|
|
647
|
-
* @returns Decoded html string.
|
|
648
|
-
*/var decodeHTMLEntities=function decodeHTMLEntities(htmlString){if(globalContext.document){var textareaDomNode=globalContext.document.createElement("textarea");textareaDomNode.innerHTML=htmlString;return textareaDomNode.value}return null};/**
|
|
649
|
-
* Converts a delimited string to its camel case representation.
|
|
650
|
-
* @param value - The string to format.
|
|
651
|
-
* @param delimiter - Delimiter string to use.
|
|
652
|
-
* @param abbreviations - Collection of shortcut words to represent uppercased.
|
|
653
|
-
* @param preserveWrongFormattedAbbreviations - If set to "True" wrong
|
|
654
|
-
* formatted camel case abbreviations will be ignored.
|
|
655
|
-
* @param removeMultipleDelimiter - Indicates whether a series of delimiter
|
|
656
|
-
* should be consolidated.
|
|
657
|
-
* @returns The formatted string.
|
|
658
|
-
*/var delimitedToCamelCase=function delimitedToCamelCase(value,delimiter,abbreviations,preserveWrongFormattedAbbreviations,removeMultipleDelimiter){if(delimiter===void 0){delimiter="-"}if(abbreviations===void 0){abbreviations=null}if(preserveWrongFormattedAbbreviations===void 0){preserveWrongFormattedAbbreviations=false}if(removeMultipleDelimiter===void 0){removeMultipleDelimiter=false}var escapedDelimiter=maskForRegularExpression(delimiter);if(!abbreviations)abbreviations=ABBREVIATIONS;var abbreviationPattern;if(preserveWrongFormattedAbbreviations)abbreviationPattern=ABBREVIATIONS.join("|");else{abbreviationPattern="";var _iterator4=_createForOfIteratorHelper(abbreviations),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var abbreviation=_step4.value;if(abbreviationPattern)abbreviationPattern+="|";abbreviationPattern+="".concat(capitalize(abbreviation),"|").concat(abbreviation)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}var stringStartsWithDelimiter=value.startsWith(delimiter);if(stringStartsWithDelimiter)value=value.substring(delimiter.length);value=value.replace(new RegExp("(".concat(escapedDelimiter,")(").concat(abbreviationPattern,")")+"(".concat(escapedDelimiter,"|$)"),"g"),function(_fullMatch,before,abbreviation,after){return before+abbreviation.toUpperCase()+after});if(removeMultipleDelimiter)escapedDelimiter="(?:".concat(escapedDelimiter,")+");value=value.replace(new RegExp("".concat(escapedDelimiter,"([a-zA-Z0-9])"),"g"),function(_fullMatch,firstLetter){return firstLetter.toUpperCase()});if(stringStartsWithDelimiter)value=delimiter+value;return value};/**
|
|
659
|
-
* Compiles a given string as an expression with given scope names.
|
|
660
|
-
* @param expression - The string to interpret.
|
|
661
|
-
* @param scope - Scope to extract names from.
|
|
662
|
-
* @param execute - Indicates whether to execute or evaluate.
|
|
663
|
-
* @param removeGlobalScope - Indicates whether to shadow global variables via
|
|
664
|
-
* "undefined".
|
|
665
|
-
* @param binding - Object to apply as "this" in evaluation scope.
|
|
666
|
-
* @returns Object of prepared scope name mappings and compiled function or
|
|
667
|
-
* error string message if given expression couldn't be compiled.
|
|
668
|
-
*/var compile=function compile(expression,scope,execute,removeGlobalScope,binding){var _Babel;if(scope===void 0){scope=[]}if(execute===void 0){execute=false}if(removeGlobalScope===void 0){removeGlobalScope=true}if(binding===void 0){binding={}}/*
|
|
669
|
-
NOTE: We do this global variable name determining as close as possible
|
|
670
|
-
to the compiling step to cover as much as possible global introduces
|
|
671
|
-
variables.
|
|
672
|
-
*/var globalNames=Object.keys(globalThis).concat("globalThis").filter(function(name){return new RegExp("^[".concat(ALLOWED_STARTING_VARIABLE_SYMBOLS,"]")+"[".concat(ALLOWED_VARIABLE_SYMBOLS,"]*$")).test(name)});var result={error:null,globalNames:globalNames,globalNamesUndefinedList:globalNames.map(function(){return undefined}),originalScopeNames:Array.isArray(scope)?scope:typeof scope==="string"?[scope]:Object.keys(scope),scopeNameMapping:{},scopeNames:[],templateFunction:function templateFunction(){return undefined}};var _iterator5=_createForOfIteratorHelper(result.originalScopeNames),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var name=_step5.value;var newName=convertToValidVariableName(name);result.scopeNameMapping[name]=newName;result.scopeNames.push(newName)}// region try to polyfill template string literals for older engines
|
|
673
|
-
}catch(err){_iterator5.e(err)}finally{_iterator5.f()}if(POLYFILL_TEMPLATE_STRINGS.value)if((_Babel=_context__WEBPACK_IMPORTED_MODULE_1__.globalContext.Babel)!==null&&_Babel!==void 0&&_Babel.transform)expression=_context__WEBPACK_IMPORTED_MODULE_1__.globalContext.Babel.transform("(".concat(expression,")"),{plugins:["transform-template-literals"]}).code;else if(expression.startsWith("`")&&expression.endsWith("`")){var escapeMarker="####";// Convert template string into legacy string concatenations.
|
|
674
|
-
expression=expression// Mark simple escape sequences.
|
|
675
|
-
.replace(/\\\$/g,escapeMarker)// Handle avoidable template expression: Use raw code.
|
|
676
|
-
.replace(/^`\$\{([\s\S]+)}`$/,"String($1)")// Use plain string with single quotes.
|
|
677
|
-
.replace(/^`([^']+)`$/,"'$1'")// Use plain string with double quotes.
|
|
678
|
-
.replace(/^`([^"]+)`$/,"\"$1\"");// Use single quotes and hope (just a heuristic).
|
|
679
|
-
var quote=expression.charAt(0)==="`"?"'":expression.charAt(0);expression=expression// Replace a simple placeholder.
|
|
680
|
-
// NOTE: Replace complete bracket pairs.
|
|
681
|
-
.replace(/\$\{((([^{]*{[^}]*}[^}]*})|[^{}]+)+)}/g,"".concat(quote,"+($1)+").concat(quote)).replace(/^`([\s\S]+)`$/,"".concat(quote,"$1").concat(quote))// Remove remaining newlines.
|
|
682
|
-
.replace(/\n+/g,"")// Replace marked escape sequences.
|
|
683
|
-
.replace(new RegExp(escapeMarker,"g"),"\\$")}// endregion
|
|
684
|
-
var innerTemplateFunction;try{// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
685
|
-
innerTemplateFunction=_construct(Function,_toConsumableArray(removeGlobalScope?result.globalNames:[]).concat(_toConsumableArray(result.scopeNames),["".concat(execute?"":"return ").concat(expression)]))}catch(error){result.error="Given expression \"".concat(expression,"\" could not be compiled width ")+"given scope names \"".concat(result.scopeNames.join("\", \""),"\": ")+(0,_object__WEBPACK_IMPORTED_MODULE_2__.represent)(error)}if(innerTemplateFunction){var boundInnerTemplateFunction=innerTemplateFunction.bind(binding);result.templateFunction=removeGlobalScope?function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}return(/*
|
|
686
|
-
NOTE: We shadow existing global names to sandbox
|
|
687
|
-
expressions.
|
|
688
|
-
*/boundInnerTemplateFunction.apply(void 0,_toConsumableArray(result.globalNamesUndefinedList).concat(parameters)))}:boundInnerTemplateFunction}return result};/**
|
|
689
|
-
* Evaluates a given string as an expression against a given scope.
|
|
690
|
-
* @param expression - The string to interpret.
|
|
691
|
-
* @param scope - Scope to render against.
|
|
692
|
-
* @param execute - Indicates whether to execute or evaluate.
|
|
693
|
-
* @param removeGlobalScope - Indicates whether to shadow global variables via
|
|
694
|
-
* "undefined".
|
|
695
|
-
* @param binding - Object to apply as "this" in evaluation scope.
|
|
696
|
-
* @returns Object with an error message during parsing / running or result.
|
|
697
|
-
*/var evaluate=function evaluate(expression,scope,execute,removeGlobalScope,binding){if(scope===void 0){scope={}}if(execute===void 0){execute=false}if(removeGlobalScope===void 0){removeGlobalScope=true}if(binding===void 0){binding={}}// NOTE: We extract string-only types from given scope type.
|
|
698
|
-
var _compile=compile(expression,scope,execute,removeGlobalScope,binding),error=_compile.error,originalScopeNames=_compile.originalScopeNames,scopeNames=_compile.scopeNames,templateFunction=_compile.templateFunction;var result={compileError:null,runtimeError:null,error:"Not yet evaluated.",result:undefined};if(error){result.compileError=result.error=error;return result}try{result={compileError:null,runtimeError:null,error:null,result:templateFunction.apply(void 0,_toConsumableArray(originalScopeNames.map(function(name){return scope[name]})))}}catch(error){result.error=result.runtimeError="Given expression \"".concat(expression,"\" could not be evaluated ")+"with given scope names \"".concat(scopeNames.join("\", \""),"\": ")+(0,_object__WEBPACK_IMPORTED_MODULE_2__.represent)(error)}return result};/**
|
|
699
|
-
* Evaluates a given string as an expression against a given scope. Does same
|
|
700
|
-
* as "evaluate" but throws an exception if an error occurs and returns the
|
|
701
|
-
* evaluated value instead of an object with error and result.
|
|
702
|
-
* @param expression - The string to interpret.
|
|
703
|
-
* @param scope - Scope to render against.
|
|
704
|
-
* @param execute - Indicates whether to execute or evaluate.
|
|
705
|
-
* @param removeGlobalScope - Indicates whether to shadow global variables via
|
|
706
|
-
* "undefined".
|
|
707
|
-
* @param binding - Object to apply as "this" in evaluation scope.
|
|
708
|
-
* @returns Object with an error message during parsing / running or result.
|
|
709
|
-
*/var evaluateAndThrowError=function evaluateAndThrowError(expression,scope,execute,removeGlobalScope,binding){if(scope===void 0){scope={}}if(execute===void 0){execute=false}if(removeGlobalScope===void 0){removeGlobalScope=true}if(binding===void 0){binding={}}var evaluated=evaluate(expression,scope,execute,removeGlobalScope,binding);if(evaluated.error)throw new Error(evaluated.error);return evaluated.result};/**
|
|
710
|
-
* Finds the string match of a given query in a given target text by applying a
|
|
711
|
-
* given normalization function to target and query.
|
|
712
|
-
* @param target - Target to search in.
|
|
713
|
-
* @param query - Search string to search for.
|
|
714
|
-
* @param normalizer - Function to use as normalization for queries and search
|
|
715
|
-
* targets.
|
|
716
|
-
* @param skipTagDelimitedParts - Indicates whether to, for example, ignore
|
|
717
|
-
* html tags via "['<', '>']" (the default).
|
|
718
|
-
* @returns Start and end index of matching range.
|
|
719
|
-
*/var findNormalizedMatchRange=function findNormalizedMatchRange(target,query,normalizer,skipTagDelimitedParts){if(normalizer===void 0){normalizer=function normalizer(value){return String(value).toLowerCase()}}if(skipTagDelimitedParts===void 0){skipTagDelimitedParts=["<",">"]}var normalizedQuery=normalizer(query);var normalizedTarget=normalizer(target);var stringTarget=typeof target==="string"?target:normalizedTarget;if(normalizedTarget&&normalizedQuery){var inTag=false;for(var index=0;index<stringTarget.length;index+=1){if(inTag){if(Array.isArray(skipTagDelimitedParts)&&stringTarget.charAt(index)===skipTagDelimitedParts[1])inTag=false;continue}if(Array.isArray(skipTagDelimitedParts)&&stringTarget.charAt(index)===skipTagDelimitedParts[0]){inTag=true;continue}if(normalizer(stringTarget.substring(index)).startsWith(normalizedQuery)){if(normalizedQuery.length===1)return[index,index+1];for(var subIndex=stringTarget.length;subIndex>index;subIndex-=1)if(!normalizer(stringTarget.substring(index,subIndex)).startsWith(normalizedQuery))return[index,subIndex+1]}}}return null};/**
|
|
720
|
-
* Fixes known encoding problems in given data.
|
|
721
|
-
* @param data - To process.
|
|
722
|
-
* @returns Processed data.
|
|
723
|
-
*/var fixKnownEncodingErrors=function fixKnownEncodingErrors(data){for(var _i=0,_FIX_ENCODING_ERROR_M=FIX_ENCODING_ERROR_MAPPING;_i<_FIX_ENCODING_ERROR_M.length;_i++){var _FIX_ENCODING_ERROR_M2=_slicedToArray(_FIX_ENCODING_ERROR_M[_i],2),search=_FIX_ENCODING_ERROR_M2[0],replacement=_FIX_ENCODING_ERROR_M2[1];data=data.replace(new RegExp(search,"g"),replacement)}return data};/**
|
|
724
|
-
* Performs a string formation. Replaces every placeholder "{i}" with the i'th
|
|
725
|
-
* argument.
|
|
726
|
-
* @param string - The string to format.
|
|
727
|
-
* @param additionalArguments - Additional arguments are interpreted as
|
|
728
|
-
* replacements for string formatting.
|
|
729
|
-
* @returns The formatted string.
|
|
730
|
-
*/var format=function format(string){for(var _len2=arguments.length,additionalArguments=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){additionalArguments[_key2-1]=arguments[_key2]}additionalArguments.unshift(string);var index=0;for(var _i2=0,_additionalArguments=additionalArguments;_i2<_additionalArguments.length;_i2++){var _value2=_additionalArguments[_i2];string=string.replace(new RegExp("\\{".concat(String(index),"\\}"),"gm"),String(_value2));index+=1}return string};/**
|
|
731
|
-
* Calculates the edit (levenstein) distance between two given strings.
|
|
732
|
-
* @param first - First string to compare.
|
|
733
|
-
* @param second - Second string to compare.
|
|
734
|
-
* @returns The distance as number.
|
|
735
|
-
*/var getEditDistance=function getEditDistance(first,second){/*
|
|
736
|
-
Create empty edit distance matrix for all possible modifications of
|
|
737
|
-
substrings of "first" to substrings of "second".
|
|
738
|
-
*/var distanceMatrix=Array(second.length+1).fill(null).map(function(){return Array(first.length+1).fill(null)});/*
|
|
739
|
-
Fill the first row of the matrix.
|
|
740
|
-
If this is the first row, then, we're transforming an empty string to
|
|
741
|
-
"first". In this case the number of transformations equals to the size
|
|
742
|
-
of the "first" substring.
|
|
743
|
-
*/for(var index=0;index<=first.length;index++)distanceMatrix[0][index]=index;/*
|
|
744
|
-
Fill the first column of the matrix.
|
|
745
|
-
If this is the first column, then we're transforming an empty string to
|
|
746
|
-
"second".
|
|
747
|
-
In this case the number of transformations equals to the size of the
|
|
748
|
-
"second" substring.
|
|
749
|
-
*/for(var _index=0;_index<=second.length;_index++)distanceMatrix[_index][0]=_index;for(var firstIndex=1;firstIndex<=second.length;firstIndex++)for(var secondIndex=1;secondIndex<=first.length;secondIndex++){var indicator=first[secondIndex-1]===second[firstIndex-1]?0:1;distanceMatrix[firstIndex][secondIndex]=Math.min(// deletion
|
|
750
|
-
distanceMatrix[firstIndex][secondIndex-1]+1,// insertion
|
|
751
|
-
distanceMatrix[firstIndex-1][secondIndex]+1,// substitution
|
|
752
|
-
distanceMatrix[firstIndex-1][secondIndex-1]+indicator)}return distanceMatrix[second.length][first.length]};/**
|
|
753
|
-
* Validates the current string for using in a regular expression pattern.
|
|
754
|
-
* Special regular expression chars will be escaped.
|
|
755
|
-
* @param value - The string to format.
|
|
756
|
-
* @returns The formatted string.
|
|
757
|
-
*/var maskForRegularExpression=function maskForRegularExpression(value){return value.replace(/([\\|.*$^+[\]()?\-{}])/g,"\\$1")};/**
|
|
758
|
-
* Converts a string to its lower case representation.
|
|
759
|
-
* @param string - The string to format.
|
|
760
|
-
* @returns The formatted string.
|
|
761
|
-
*/var lowerCase=function lowerCase(string){return string.charAt(0).toLowerCase()+string.substring(1)};/**
|
|
762
|
-
* Wraps given mark strings in a given target with a given marker.
|
|
763
|
-
* @param target - String to search for marker.
|
|
764
|
-
* @param givenWords - String or array of strings to search in target for.
|
|
765
|
-
* @param givenOptions - Defines highlighting behavior.
|
|
766
|
-
* @param givenOptions.marker - HTML template string to mark.
|
|
767
|
-
* @param givenOptions.normalizer - Pure normalization function to use before
|
|
768
|
-
* searching for matches.
|
|
769
|
-
* @param givenOptions.skipTagDelimitedParts - Indicates whether to, for
|
|
770
|
-
* example, ignore html tags via "['<', '>']" (the default).
|
|
771
|
-
* @returns Processed result.
|
|
772
|
-
*/var mark=function mark(target,givenWords,givenOptions){if(givenOptions===void 0){givenOptions={}}if(typeof target==="string"&&givenWords!==null&&givenWords!==void 0&&givenWords.length){var _options=_objectSpread({marker:"<span class=\"tools-mark\">{1}</span>",normalizer:function normalizer(value){return String(value).toLowerCase()},skipTagDelimitedParts:["<",">"]},givenOptions);target=target.trim();var markedTarget=[];var words=[].concat(givenWords);var index=0;var _iterator6=_createForOfIteratorHelper(words),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _word=_step6.value;words[index]=_options.normalizer(_word).trim();index+=1}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}var restTarget=target;var offset=0;/*
|
|
773
|
-
Search for matches as long there is enough target text remaining to
|
|
774
|
-
walk through.
|
|
775
|
-
*/for(var iteration=0;iteration<MAXIMAL_NUMBER_OF_ITERATIONS.value;iteration++){var nearestRange=null;var currentRange=void 0;// Find the nearest next matching word.
|
|
776
|
-
var _iterator7=_createForOfIteratorHelper(words),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var word=_step7.value;currentRange=findNormalizedMatchRange(restTarget,word,_options.normalizer,_options.skipTagDelimitedParts);if(currentRange&&(!nearestRange||currentRange[0]<nearestRange[0]))nearestRange=currentRange}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}if(nearestRange){if(nearestRange[0]>0)markedTarget.push(target.substring(offset,offset+nearestRange[0]));markedTarget.push(typeof _options.marker==="string"?format(_options.marker,target.substring(offset+nearestRange[0],offset+nearestRange[1])):_options.marker(target.substring(offset+nearestRange[0],offset+nearestRange[1]),markedTarget));offset+=nearestRange[1];restTarget=target.substring(offset)}else{if(restTarget.length)markedTarget.push(restTarget);break}}return typeof _options.marker==="string"?markedTarget.join(""):markedTarget}return target};/**
|
|
777
|
-
* Normalizes a given phone number for automatic dialing or comparison.
|
|
778
|
-
* @param value - Number to normalize.
|
|
779
|
-
* @param dialable - Indicates whether the result should be dialed or
|
|
780
|
-
* represented as lossless data.
|
|
781
|
-
* @returns Normalized number.
|
|
782
|
-
*/var normalizePhoneNumber=function normalizePhoneNumber(value,dialable){if(dialable===void 0){dialable=true}if(typeof value==="string"||typeof value==="number"){var normalizedValue=String(value).trim();// Normalize country code prefix.
|
|
783
|
-
normalizedValue=normalizedValue.replace(/^[^0-9]*\+/,"00");// Remove alternate direct dial numbers.
|
|
784
|
-
normalizedValue=normalizedValue.replace(/([0-9].*?) *(,|o[rd]?)\.? ?-?[0-9]+$/,"$1");if(dialable)return normalizedValue.replace(/[^0-9]+/g,"");var separatorPattern="(?:[ /\\-]+)";// Remove unneeded area code zero in brackets.
|
|
785
|
-
normalizedValue=normalizedValue.replace(new RegExp("^(.+?)".concat(separatorPattern,"?\\(0\\)").concat(separatorPattern,"?")+"(.+)$"),"$1-$2");// Remove unneeded area code brackets.
|
|
786
|
-
normalizedValue=normalizedValue.replace(new RegExp("^(.+?)".concat(separatorPattern,"?\\((.+)\\)")+"".concat(separatorPattern,"?(.+)$")),"$1-$2-$3");/*
|
|
787
|
-
Remove separators that don't mark semantics:
|
|
788
|
-
1: Country code
|
|
789
|
-
2: Area code
|
|
790
|
-
3: Number
|
|
791
|
-
*/var compiledPattern=new RegExp("^(00[0-9]+)".concat(separatorPattern,"([0-9]+)").concat(separatorPattern)+"(.+)$");if(compiledPattern.test(normalizedValue))// Country code and area code matched.
|
|
792
|
-
normalizedValue=normalizedValue.replace(compiledPattern,function(_match,countryCode,areaCode,number){return"".concat(countryCode,"-").concat(areaCode,"-")+sliceAllExceptNumberAndLastSeparator(number)});else{/*
|
|
793
|
-
One prefix code matched:
|
|
794
|
-
1: Prefix code
|
|
795
|
-
2: Number
|
|
796
|
-
*/compiledPattern=/^([0-9 ]+)[/-](.+)$/;var replacer=function replacer(_match,prefixCode,number){return"".concat(prefixCode.replace(/ +/,""),"-")+sliceAllExceptNumberAndLastSeparator(number)};if(compiledPattern.test(normalizedValue))// Prefer "/" or "-" over " " as area code separator.
|
|
797
|
-
normalizedValue=normalizedValue.replace(compiledPattern,replacer);else normalizedValue=normalizedValue.replace(new RegExp("^([0-9]+)".concat(separatorPattern,"(.+)$")),replacer)}return normalizedValue.replace(/[^0-9-]+/g,"").replace(/^-+$/,"")}return""};/**
|
|
798
|
-
* Normalizes a given zip code for automatic address processing.
|
|
799
|
-
* @param value - Number to normalize.
|
|
800
|
-
* @returns Normalized number.
|
|
801
|
-
*/var normalizeZipCode=function normalizeZipCode(value){if(typeof value==="string"||typeof value==="number")return String(value).trim().replace(/^([^0-9]*[a-zA-Z]-)?(.+)$/,function(match,prefix,code){if(prefix)prefix=prefix.substring(prefix.length-2).charAt(0).toUpperCase()+"-";return(prefix!==null&&prefix!==void 0?prefix:"")+(code!==null&&code!==void 0?code:"").trim().replace(/[^0-9]+/g,"")});return""};/**
|
|
802
|
-
* Converts a given serialized, base64 encoded or file path given object into a
|
|
803
|
-
* native JavaScript one if possible.
|
|
804
|
-
* @param serializedObject - Object as string.
|
|
805
|
-
* @param scope - An optional scope which will be used to evaluate given object
|
|
806
|
-
* in.
|
|
807
|
-
* @param name - The name under given scope will be available.
|
|
808
|
-
* @returns The parsed object if possible and null otherwise.
|
|
809
|
-
*/var parseEncodedObject=function parseEncodedObject(serializedObject,scope,name){var _imports$fs;if(scope===void 0){scope={}}if(name===void 0){name="scope"}if(!((_imports$fs=imports.fs)!==null&&_imports$fs!==void 0&&_imports$fs.readFileSync))throw new Error("File system api could not be loaded.");if(serializedObject.endsWith(".json")&&isFileSync(serializedObject))serializedObject=imports.fs.readFileSync(serializedObject,{encoding:DEFAULT_ENCODING});serializedObject=serializedObject.trim();if(!serializedObject.startsWith("{"))serializedObject=eval("Buffer").from(serializedObject,"base64").toString(DEFAULT_ENCODING);var result=evaluate(serializedObject,_defineProperty({},name,scope));if(_typeof(result.result)==="object")return result.result;return null};/**
|
|
810
|
-
* Represents a given phone number. NOTE: Currently only support German phone
|
|
811
|
-
* numbers.
|
|
812
|
-
* @param value - Number to format.
|
|
813
|
-
* @returns Formatted number.
|
|
814
|
-
*/var representPhoneNumber=function representPhoneNumber(value){if(["number","string"].includes(determineType(value))&&value){// Represent country code and leading area code zero.
|
|
815
|
-
var normalizedValue=// eslint-disable-next-line @typescript-eslint/no-base-to-string
|
|
816
|
-
String(value).replace(/^(00|\+)([0-9]+)-([0-9-]+)$/,"+$2 (0) $3");// Add German country code if not exists.
|
|
817
|
-
normalizedValue=normalizedValue.replace(/^0([1-9][0-9-]+)$/,"+49 (0) $1");// Separate area code from base number.
|
|
818
|
-
normalizedValue=normalizedValue.replace(/^([^-]+)-([0-9-]+)$/,"$1 / $2");// Partition base number in one triple and tuples or tuples only.
|
|
819
|
-
return normalizedValue.replace(/^(.*?)([0-9]+)(-?[0-9]*)$/,function(_match,prefix,number,suffix){return prefix+(number.length%2===0?number.replace(/([0-9]{2})/g,"$1 "):number.replace(/^([0-9]{3})([0-9]+)$/,function(_match,triple,rest){return"".concat(triple," ")+rest.replace(/([0-9]{2})/g,"$1 ").trim()})+suffix).trim()}).trim()}return""};/**
|
|
820
|
-
* Slices all none numbers but preserves last separator.
|
|
821
|
-
* @param value - String to process.
|
|
822
|
-
* @returns - Sliced given value.
|
|
823
|
-
*/var sliceAllExceptNumberAndLastSeparator=function sliceAllExceptNumberAndLastSeparator(value){/*
|
|
824
|
-
1: baseNumber
|
|
825
|
-
2: directDialingNumberSuffix
|
|
826
|
-
*/var compiledPattern=/^(.*[0-9].*)-([0-9]+)$/;if(compiledPattern.test(value))return value.replace(compiledPattern,function(_match,baseNumber,directDialingNumberSuffix){return"".concat(baseNumber.replace(/[^0-9]+/g,""),"-")+directDialingNumberSuffix});return value.replace(/[^0-9]+/g,"")};/**
|
|
827
|
-
* Converts a dom selector to a prefixed dom selector string.
|
|
828
|
-
* @param selector - A dom node selector.
|
|
829
|
-
* @param selectorPrefix - A dom node selector prefix to take into account.
|
|
830
|
-
* @returns Returns given selector prefixed.
|
|
831
|
-
*/var normalizeDomNodeSelector=function normalizeDomNodeSelector(selector,selectorPrefix){if(selectorPrefix===void 0){selectorPrefix=""}var domNodeSelectorPrefix="";if(selectorPrefix)domNodeSelectorPrefix="".concat(selectorPrefix," ");if(!(selector.startsWith(domNodeSelectorPrefix)||selector.trim().startsWith("<")))selector=domNodeSelectorPrefix+selector;return selector.trim()};/**
|
|
832
|
-
* Abbreviates a given string if it excesses a given limit.
|
|
833
|
-
* @param value - String to abbreviate.
|
|
834
|
-
* @param limit - Maximum length of processed string.
|
|
835
|
-
* @returns Abbreviated given string.
|
|
836
|
-
*/var limit=function limit(value,_limit){if(_limit===void 0){_limit=100}if(value.length<=_limit)return value;var dots="...";return value.substring(0,_limit-dots.length)+dots};
|
|
837
|
-
|
|
838
|
-
/***/ }),
|
|
839
|
-
/* 7 */
|
|
840
|
-
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
841
|
-
|
|
842
|
-
"use strict";
|
|
843
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
844
|
-
/* harmony export */ isNotANumber: function() { return /* binding */ isNotANumber; }
|
|
845
|
-
/* harmony export */ });
|
|
846
|
-
/* unused harmony exports getUTCTimestamp, round, ceil, floor */
|
|
847
|
-
/* harmony import */ var _object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
848
|
-
// #!/usr/bin/env babel-node
|
|
849
|
-
// -*- coding: utf-8 -*-
|
|
850
|
-
/** @module number *//* !
|
|
851
|
-
region header
|
|
852
|
-
[Project page](https://torben.website/clientnode)
|
|
853
|
-
|
|
854
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
855
|
-
|
|
856
|
-
License
|
|
857
|
-
-------
|
|
858
|
-
|
|
859
|
-
This library written by Torben Sickert stands under a creative commons
|
|
860
|
-
naming 3.0 unported license.
|
|
861
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
862
|
-
endregion
|
|
863
|
-
*//**
|
|
864
|
-
* Determines corresponding utc timestamp for given date object.
|
|
865
|
-
* @param value - Date to convert.
|
|
866
|
-
* @param inMilliseconds - Indicates whether given number should be in
|
|
867
|
-
* seconds (default) or milliseconds.
|
|
868
|
-
* @returns Determined numerous value.
|
|
869
|
-
*/var getUTCTimestamp=function getUTCTimestamp(value,inMilliseconds){if(inMilliseconds===void 0){inMilliseconds=false}var date=[null,undefined].includes(value)?new Date:new Date(value);return Date.UTC(date.getUTCFullYear(),date.getUTCMonth(),date.getUTCDate(),date.getUTCHours(),date.getUTCMinutes(),date.getUTCSeconds(),date.getUTCMilliseconds())/(inMilliseconds?1:1000)};/**
|
|
870
|
-
* Checks if given object is java scripts native "Number.NaN" object.
|
|
871
|
-
* @param value - Value to check.
|
|
872
|
-
* @returns Returns whether given value is not a number or not.
|
|
873
|
-
*/var isNotANumber=function isNotANumber(value){return (0,_object__WEBPACK_IMPORTED_MODULE_0__.determineType)(value)==="number"&&isNaN(value)};/**
|
|
874
|
-
* Rounds a given number accurate to given number of digits.
|
|
875
|
-
* @param number - The number to round.
|
|
876
|
-
* @param digits - The number of digits after comma.
|
|
877
|
-
* @returns Returns the rounded number.
|
|
878
|
-
*/var round=function round(number,digits){if(digits===void 0){digits=0}return Math.round(number*Math.pow(10,digits))/Math.pow(10,digits)};/**
|
|
879
|
-
* Rounds a given number up accurate to given number of digits.
|
|
880
|
-
* @param number - The number to round.
|
|
881
|
-
* @param digits - The number of digits after comma.
|
|
882
|
-
* @returns Returns the rounded number.
|
|
883
|
-
*/var ceil=function ceil(number,digits){if(digits===void 0){digits=0}return Math.ceil(number*Math.pow(10,digits))/Math.pow(10,digits)};/**
|
|
884
|
-
* Rounds a given number down accurate to given number of digits.
|
|
885
|
-
* @param number - The number to round.
|
|
886
|
-
* @param digits - The number of digits after comma.
|
|
887
|
-
* @returns Returns the rounded number.
|
|
888
|
-
*/var floor=function floor(number,digits){if(digits===void 0){digits=0}return Math.floor(number*Math.pow(10,digits))/Math.pow(10,digits)};
|
|
889
|
-
|
|
890
|
-
/***/ })
|
|
891
|
-
/******/ ]);
|
|
892
|
-
/************************************************************************/
|
|
893
|
-
/******/ // The module cache
|
|
894
|
-
/******/ var __webpack_module_cache__ = {};
|
|
895
|
-
/******/
|
|
896
|
-
/******/ // The require function
|
|
897
|
-
/******/ function __webpack_require__(moduleId) {
|
|
898
|
-
/******/ // Check if module is in cache
|
|
899
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
900
|
-
/******/ if (cachedModule !== undefined) {
|
|
901
|
-
/******/ return cachedModule.exports;
|
|
902
|
-
/******/ }
|
|
903
|
-
/******/ // Create a new module (and put it into the cache)
|
|
904
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
905
|
-
/******/ id: moduleId,
|
|
906
|
-
/******/ loaded: false,
|
|
907
|
-
/******/ exports: {}
|
|
908
|
-
/******/ };
|
|
909
|
-
/******/
|
|
910
|
-
/******/ // Execute the module function
|
|
911
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
912
|
-
/******/
|
|
913
|
-
/******/ // Flag the module as loaded
|
|
914
|
-
/******/ module.loaded = true;
|
|
915
|
-
/******/
|
|
916
|
-
/******/ // Return the exports of the module
|
|
917
|
-
/******/ return module.exports;
|
|
918
|
-
/******/ }
|
|
919
|
-
/******/
|
|
920
|
-
/******/ // expose the module cache
|
|
921
|
-
/******/ __webpack_require__.c = __webpack_module_cache__;
|
|
922
|
-
/******/
|
|
923
|
-
/************************************************************************/
|
|
924
|
-
/******/ /* webpack/runtime/define property getters */
|
|
925
|
-
/******/ !function() {
|
|
926
|
-
/******/ // define getter/value functions for harmony exports
|
|
927
|
-
/******/ __webpack_require__.d = function(exports, definition) {
|
|
928
|
-
/******/ if(Array.isArray(definition)) {
|
|
929
|
-
/******/ var i = 0;
|
|
930
|
-
/******/ while(i < definition.length) {
|
|
931
|
-
/******/ var key = definition[i++];
|
|
932
|
-
/******/ var binding = definition[i++];
|
|
933
|
-
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
934
|
-
/******/ if(binding === 0) {
|
|
935
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
936
|
-
/******/ } else {
|
|
937
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
938
|
-
/******/ }
|
|
939
|
-
/******/ } else if(binding === 0) { i++; }
|
|
940
|
-
/******/ }
|
|
941
|
-
/******/ } else {
|
|
942
|
-
/******/ for(var key in definition) {
|
|
943
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
944
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
945
|
-
/******/ }
|
|
946
|
-
/******/ }
|
|
947
|
-
/******/ }
|
|
948
|
-
/******/ };
|
|
949
|
-
/******/ }();
|
|
950
|
-
/******/
|
|
951
|
-
/******/ /* webpack/runtime/global */
|
|
952
|
-
/******/ !function() {
|
|
953
|
-
/******/ __webpack_require__.g = (function() {
|
|
954
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
955
|
-
/******/ try {
|
|
956
|
-
/******/ return this || new Function('return this')();
|
|
957
|
-
/******/ } catch (e) {
|
|
958
|
-
/******/ if (typeof window === 'object') return window;
|
|
959
|
-
/******/ }
|
|
960
|
-
/******/ })();
|
|
961
|
-
/******/ }();
|
|
962
|
-
/******/
|
|
963
|
-
/******/ /* webpack/runtime/harmony module decorator */
|
|
964
|
-
/******/ !function() {
|
|
965
|
-
/******/ __webpack_require__.hmd = function(module) {
|
|
966
|
-
/******/ module = Object.create(module);
|
|
967
|
-
/******/ if (!module.children) module.children = [];
|
|
968
|
-
/******/ Object.defineProperty(module, 'exports', {
|
|
969
|
-
/******/ enumerable: true,
|
|
970
|
-
/******/ set: function() {
|
|
971
|
-
/******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
|
|
972
|
-
/******/ }
|
|
973
|
-
/******/ });
|
|
974
|
-
/******/ return module;
|
|
975
|
-
/******/ };
|
|
976
|
-
/******/ }();
|
|
977
|
-
/******/
|
|
978
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
979
|
-
/******/ !function() {
|
|
980
|
-
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
981
|
-
/******/ }();
|
|
982
|
-
/******/
|
|
983
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
984
|
-
/******/ !function() {
|
|
985
|
-
/******/ // define __esModule on exports
|
|
986
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
987
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
988
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
989
|
-
/******/ }
|
|
990
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
991
|
-
/******/ };
|
|
992
|
-
/******/ }();
|
|
993
|
-
/******/
|
|
994
|
-
/************************************************************************/
|
|
995
|
-
/******/
|
|
996
|
-
/******/ // module cache are used so entry inlining is disabled
|
|
997
|
-
/******/ // startup
|
|
998
|
-
/******/ // Load entry module and return exports
|
|
999
|
-
/******/ var __webpack_exports__ = __webpack_require__(2);
|
|
1000
|
-
/******/
|
|
1001
|
-
/******/ return __webpack_exports__;
|
|
1002
|
-
/******/ })()
|
|
1003
|
-
;
|
|
1004
|
-
});
|