clientnode 4.0.1488 → 4.0.1490
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/Logger.js +7 -3
- package/dist/array.js +7 -3
- package/dist/bundle/index.js +47 -33
- package/dist/compatible/Logger.js +7 -3
- package/dist/compatible/array.js +7 -3
- package/dist/compatible/data-transfer.js +7 -3
- package/dist/compatible/datetime.js +43 -33
- package/dist/compatible/domNode.js +5 -1
- package/dist/compatible/expression/evaluators.js +41 -31
- package/dist/compatible/expression/index.js +41 -31
- package/dist/compatible/expression/indicator-functions.js +5 -1
- package/dist/compatible/index.js +47 -33
- package/dist/compatible/indicators.js +7 -3
- package/dist/compatible/number.js +2 -2
- package/dist/compatible/object.js +41 -31
- package/dist/compatible/scope.js +44 -32
- package/dist/compatible/string.js +43 -31
- package/dist/compatible/test-helper.js +7 -3
- package/dist/compatible/utility.js +5 -1
- package/dist/data-transfer.js +7 -3
- package/dist/datetime.js +43 -33
- package/dist/domNode.js +5 -1
- package/dist/expression/evaluators.js +41 -31
- package/dist/expression/index.js +41 -31
- package/dist/expression/indicator-functions.js +5 -1
- package/dist/index.js +47 -33
- package/dist/indicators.js +7 -3
- package/dist/number.js +2 -2
- package/dist/object.js +41 -31
- package/dist/scope.js +44 -32
- package/dist/string.d.ts +25 -19
- package/dist/string.js +43 -31
- package/dist/test-helper.js +7 -3
- package/dist/type.d.ts +12 -0
- package/dist/utility.js +5 -1
- package/package.json +7 -7
|
@@ -233,7 +233,7 @@ if(options.deep!==0){var result=_equals(value,second[key],_objectSpread(_objectS
|
|
|
233
233
|
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
234
234
|
* a value to evaluate.
|
|
235
235
|
* @returns Evaluated given mapping.
|
|
236
|
-
*/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 evaluateOrThrowError(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__"&&isObject(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
236
|
+
*/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 evaluateOrThrowError(code,{scope:options.scope,async:false,execute: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__"&&isObject(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
237
237
|
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")/*
|
|
238
238
|
eslint-disable
|
|
239
239
|
@typescript-eslint/unbound-method
|
|
@@ -261,7 +261,7 @@ for(var _i18=0,_arr9=[options.expressionIndicatorKey,options.executionIndicatorK
|
|
|
261
261
|
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
262
262
|
* a value to evaluate.
|
|
263
263
|
* @returns Evaluated given mapping.
|
|
264
|
-
*/var _evaluateAsyncDynamicData=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,index,_iterator16,_step16,item,_i21,_Object$entries1,_Object$entries1$_i,key,value,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if(isObject(data)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;if(!Array.isArray(data)){_context.n=10;break}index=0;_iterator16=_createForOfIteratorHelper(data);_context.p=2;_iterator16.s();case 3:if((_step16=_iterator16.n()).done){_context.n=6;break}item=_step16.value;_context.n=4;return _evaluateAsyncDynamicData(item,options);case 4:result[index]=_context.v;index+=1;case 5:_context.n=3;break;case 6:_context.n=8;break;case 7:_context.p=7;_t=_context.v;_iterator16.e(_t);case 8:_context.p=8;_iterator16.f();return _context.f(8);case 9:return _context.a(2,result);case 10:_i21=0,_Object$entries1=Object.entries(data);case 11:if(!(_i21<_Object$entries1.length)){_context.n=16;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=13;break}_context.n=12;return evaluateOrThrowError(value,options.scope,key===options.executionIndicatorKey);case 12:return _context.a(2,_context.v);case 13:_context.n=14;return _evaluateAsyncDynamicData(value,options);case 14:result[key]=_context.v;case 15:_i21++;_context.n=11;break;case 16:return _context.a(2,result)}},_callee,null,[[2,7,8,9]])}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}()));/**
|
|
264
|
+
*/var _evaluateAsyncDynamicData=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,index,_iterator16,_step16,item,_i21,_Object$entries1,_Object$entries1$_i,key,value,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if(isObject(data)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;if(!Array.isArray(data)){_context.n=10;break}index=0;_iterator16=_createForOfIteratorHelper(data);_context.p=2;_iterator16.s();case 3:if((_step16=_iterator16.n()).done){_context.n=6;break}item=_step16.value;_context.n=4;return _evaluateAsyncDynamicData(item,options);case 4:result[index]=_context.v;index+=1;case 5:_context.n=3;break;case 6:_context.n=8;break;case 7:_context.p=7;_t=_context.v;_iterator16.e(_t);case 8:_context.p=8;_iterator16.f();return _context.f(8);case 9:return _context.a(2,result);case 10:_i21=0,_Object$entries1=Object.entries(data);case 11:if(!(_i21<_Object$entries1.length)){_context.n=16;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=13;break}_context.n=12;return evaluateOrThrowError(value,{scope:options.scope,async:true,execute:key===options.executionIndicatorKey});case 12:return _context.a(2,_context.v);case 13:_context.n=14;return _evaluateAsyncDynamicData(value,options);case 14:result[key]=_context.v;case 15:_i21++;_context.n=11;break;case 16:return _context.a(2,result)}},_callee,null,[[2,7,8,9]])}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}()));/**
|
|
265
265
|
* Removes properties in objects where a dynamic indicator lives.
|
|
266
266
|
* @param data - Object to traverse recursively.
|
|
267
267
|
* @param expressionIndicators - Property key to remove.
|
|
@@ -407,7 +407,11 @@ result=object;if(isPlainObject(exclude)){var useCopy=false;var copy=_objectSprea
|
|
|
407
407
|
* @param value - Value to check.
|
|
408
408
|
* @returns Value "true" if given object is a plain javaScript object and
|
|
409
409
|
* "false" otherwise.
|
|
410
|
-
*/var isPlainObject=function isPlainObject(value){
|
|
410
|
+
*/var isPlainObject=function isPlainObject(value){var _prototype$constructo;if(!isObject(value))return false;var prototype=Object.getPrototypeOf(value);if(_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .PLAIN_OBJECT_PROTOTYPES */ .jE.includes(prototype))return true;/*
|
|
411
|
+
NOTE: Plain objects created in another realm (a vm context like used by
|
|
412
|
+
test runners or a worker for example) have their own "Object.prototype"
|
|
413
|
+
instance and would not be recognized by the identity check above.
|
|
414
|
+
*/return prototype!==null&&Object.getPrototypeOf(prototype)===null&&((_prototype$constructo=prototype.constructor)===null||_prototype$constructo===void 0?void 0:_prototype$constructo.name)==="Object"};/**
|
|
411
415
|
* Checks whether given object is a set.
|
|
412
416
|
* @param value - Value to check.
|
|
413
417
|
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
@@ -232,7 +232,7 @@ if(options.deep!==0){var result=_equals(value,second[key],_objectSpread(_objectS
|
|
|
232
232
|
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
233
233
|
* a value to evaluate.
|
|
234
234
|
* @returns Evaluated given mapping.
|
|
235
|
-
*/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 evaluateOrThrowError(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__"&&isObject(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
235
|
+
*/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 evaluateOrThrowError(code,{scope:options.scope,async:false,execute: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__"&&isObject(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
236
236
|
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")/*
|
|
237
237
|
eslint-disable
|
|
238
238
|
@typescript-eslint/unbound-method
|
|
@@ -260,7 +260,7 @@ for(var _i18=0,_arr9=[options.expressionIndicatorKey,options.executionIndicatorK
|
|
|
260
260
|
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
261
261
|
* a value to evaluate.
|
|
262
262
|
* @returns Evaluated given mapping.
|
|
263
|
-
*/var _evaluateAsyncDynamicData=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,index,_iterator16,_step16,item,_i21,_Object$entries1,_Object$entries1$_i,key,value,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if(isObject(data)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;if(!Array.isArray(data)){_context.n=10;break}index=0;_iterator16=_createForOfIteratorHelper(data);_context.p=2;_iterator16.s();case 3:if((_step16=_iterator16.n()).done){_context.n=6;break}item=_step16.value;_context.n=4;return _evaluateAsyncDynamicData(item,options);case 4:result[index]=_context.v;index+=1;case 5:_context.n=3;break;case 6:_context.n=8;break;case 7:_context.p=7;_t=_context.v;_iterator16.e(_t);case 8:_context.p=8;_iterator16.f();return _context.f(8);case 9:return _context.a(2,result);case 10:_i21=0,_Object$entries1=Object.entries(data);case 11:if(!(_i21<_Object$entries1.length)){_context.n=16;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=13;break}_context.n=12;return evaluateOrThrowError(value,options.scope,key===options.executionIndicatorKey);case 12:return _context.a(2,_context.v);case 13:_context.n=14;return _evaluateAsyncDynamicData(value,options);case 14:result[key]=_context.v;case 15:_i21++;_context.n=11;break;case 16:return _context.a(2,result)}},_callee,null,[[2,7,8,9]])}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}()));/**
|
|
263
|
+
*/var _evaluateAsyncDynamicData=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,index,_iterator16,_step16,item,_i21,_Object$entries1,_Object$entries1$_i,key,value,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if(isObject(data)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;if(!Array.isArray(data)){_context.n=10;break}index=0;_iterator16=_createForOfIteratorHelper(data);_context.p=2;_iterator16.s();case 3:if((_step16=_iterator16.n()).done){_context.n=6;break}item=_step16.value;_context.n=4;return _evaluateAsyncDynamicData(item,options);case 4:result[index]=_context.v;index+=1;case 5:_context.n=3;break;case 6:_context.n=8;break;case 7:_context.p=7;_t=_context.v;_iterator16.e(_t);case 8:_context.p=8;_iterator16.f();return _context.f(8);case 9:return _context.a(2,result);case 10:_i21=0,_Object$entries1=Object.entries(data);case 11:if(!(_i21<_Object$entries1.length)){_context.n=16;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=13;break}_context.n=12;return evaluateOrThrowError(value,{scope:options.scope,async:true,execute:key===options.executionIndicatorKey});case 12:return _context.a(2,_context.v);case 13:_context.n=14;return _evaluateAsyncDynamicData(value,options);case 14:result[key]=_context.v;case 15:_i21++;_context.n=11;break;case 16:return _context.a(2,result)}},_callee,null,[[2,7,8,9]])}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}()));/**
|
|
264
264
|
* Removes properties in objects where a dynamic indicator lives.
|
|
265
265
|
* @param data - Object to traverse recursively.
|
|
266
266
|
* @param expressionIndicators - Property key to remove.
|
|
@@ -406,7 +406,11 @@ result=object;if(isPlainObject(exclude)){var useCopy=false;var copy=_objectSprea
|
|
|
406
406
|
* @param value - Value to check.
|
|
407
407
|
* @returns Value "true" if given object is a plain javaScript object and
|
|
408
408
|
* "false" otherwise.
|
|
409
|
-
*/var isPlainObject=function isPlainObject(value){
|
|
409
|
+
*/var isPlainObject=function isPlainObject(value){var _prototype$constructo;if(!isObject(value))return false;var prototype=Object.getPrototypeOf(value);if(PLAIN_OBJECT_PROTOTYPES.includes(prototype))return true;/*
|
|
410
|
+
NOTE: Plain objects created in another realm (a vm context like used by
|
|
411
|
+
test runners or a worker for example) have their own "Object.prototype"
|
|
412
|
+
instance and would not be recognized by the identity check above.
|
|
413
|
+
*/return prototype!==null&&Object.getPrototypeOf(prototype)===null&&((_prototype$constructo=prototype.constructor)===null||_prototype$constructo===void 0?void 0:_prototype$constructo.name)==="Object"};/**
|
|
410
414
|
* Checks whether given object is a set.
|
|
411
415
|
* @param value - Value to check.
|
|
412
416
|
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
@@ -477,7 +481,7 @@ module.exports = webpackEmptyContext;
|
|
|
477
481
|
/* harmony export */ ZH: function() { return /* binding */ capitalize; },
|
|
478
482
|
/* harmony export */ _3: function() { return /* binding */ evaluate; }
|
|
479
483
|
/* harmony export */ });
|
|
480
|
-
/* unused harmony exports KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS, POLYFILL_TEMPLATE_STRINGS, ALLOWED_VARIABLE_SYMBOLS, ALLOWED_STARTING_VARIABLE_SYMBOLS, FIX_ENCODING_ERROR_MAPPING, escapeRegularExpressions, convertToValidVariableName, encodeURIComponentExtended, addSeparatorToPath, hasPathPrefix, getDomainName, getPortNumber, getProtocolName, getURLParameter, serviceURLEquals, normalizeURL, representURL, camelCaseToDelimited, compressStyleValue, decodeHTMLEntities, delimitedToCamelCase, compile, evaluateOrThrowError, findNormalizedMatchRange, fixKnownEncodingErrors, format, getEditDistance, maskForRegularExpression, lowerCase, mark, normalizePhoneNumber, normalizeZipCode, parseEncodedObject, representPhoneNumber, sliceAllExceptNumberAndLastSeparator, normalizeDomNodeSelector, limit */
|
|
484
|
+
/* unused harmony exports KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS, POLYFILL_TEMPLATE_STRINGS, ALLOWED_VARIABLE_SYMBOLS, ALLOWED_STARTING_VARIABLE_SYMBOLS, FIX_ENCODING_ERROR_MAPPING, AsyncFunction, escapeRegularExpressions, convertToValidVariableName, encodeURIComponentExtended, addSeparatorToPath, hasPathPrefix, getDomainName, getPortNumber, getProtocolName, getURLParameter, serviceURLEquals, normalizeURL, representURL, camelCaseToDelimited, compressStyleValue, decodeHTMLEntities, delimitedToCamelCase, compile, evaluateOrThrowError, findNormalizedMatchRange, fixKnownEncodingErrors, format, getEditDistance, maskForRegularExpression, lowerCase, mark, normalizePhoneNumber, normalizeZipCode, parseEncodedObject, representPhoneNumber, sliceAllExceptNumberAndLastSeparator, normalizeDomNodeSelector, limit */
|
|
481
485
|
/* unused harmony import specifier */ var SPECIAL_REGEX_SEQUENCES;
|
|
482
486
|
/* unused harmony import specifier */ var ABBREVIATIONS;
|
|
483
487
|
/* unused harmony import specifier */ var DEFAULT_ENCODING;
|
|
@@ -505,12 +509,13 @@ module.exports = webpackEmptyContext;
|
|
|
505
509
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
506
510
|
endregion
|
|
507
511
|
*/// region imports
|
|
508
|
-
function _defaults(e,r){for(var t=Object.getOwnPropertyNames(r),o=0;o<t.length;o++){var n=t[o],a=Object.getOwnPropertyDescriptor(r,n);a&&a.configurable&&void 0===e[n]&&Object.defineProperty(e,n,a)}return e}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
|
|
512
|
+
function _defaults(e,r){for(var t=Object.getOwnPropertyNames(r),o=0;o<t.length;o++){var n=t[o],a=Object.getOwnPropertyDescriptor(r,n);a&&a.configurable&&void 0===e[n]&&Object.defineProperty(e,n,a)}return e}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 _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 _defaults(t,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 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 _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 _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):(_defaults(e,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)})}};// endregion
|
|
509
513
|
var KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS=["default","if","for","class","function","return","const","let","var"];var POLYFILL_TEMPLATE_STRINGS={value:false};// Partial regular expression matching symbols which should be allowed within a
|
|
510
514
|
// variable name excluding the first character.
|
|
511
515
|
var ALLOWED_VARIABLE_SYMBOLS="0-9a-zA-Z_$";// Partial regular expression matching symbols which should be allowed as
|
|
512
516
|
// starting character for a variable name.
|
|
513
|
-
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"]]))
|
|
517
|
+
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"]]));var AsyncFunction=// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
518
|
+
Object.getPrototypeOf(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:return _context.a(2)}},_callee)}))).constructor;/**
|
|
514
519
|
* Translates a given string into the regular expression validated
|
|
515
520
|
* representation.
|
|
516
521
|
* @param value - String to convert.
|
|
@@ -653,18 +658,20 @@ var parameters=[];var _iterator2=_createForOfIteratorHelper(data),_step2;try{for
|
|
|
653
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};/**
|
|
654
659
|
* Compiles a given string as an expression with given scope names.
|
|
655
660
|
* @param expression - The string to interpret.
|
|
656
|
-
* @param
|
|
657
|
-
* @param
|
|
658
|
-
* @param
|
|
659
|
-
*
|
|
660
|
-
*
|
|
661
|
+
* @param givenOptions - Expression options.
|
|
662
|
+
* @param givenOptions.scope - Scope to extract names from.
|
|
663
|
+
* @param givenOptions.execute - Indicates whether to execute or evaluate.
|
|
664
|
+
* @param givenOptions.removeGlobalScope - Indicates whether to shadow global
|
|
665
|
+
* scope.
|
|
666
|
+
* @param givenOptions.binding - Object to apply as "this" in evaluation scope.
|
|
667
|
+
* @param givenOptions.async - Indicates whether to compile an async function.
|
|
661
668
|
* @returns Object of prepared scope name mappings and compiled function or
|
|
662
669
|
* error string message if given expression couldn't be compiled.
|
|
663
|
-
*/var compile=function compile(expression,
|
|
670
|
+
*/var compile=function compile(expression,givenOptions){var _Babel;if(givenOptions===void 0){givenOptions={}}var options=_objectSpread({scope:[],async:false,execute:false,removeGlobalScope:true,binding:{}},givenOptions);/*
|
|
664
671
|
NOTE: We do this global variable name determining as close as possible
|
|
665
672
|
to the compiling step to cover as much as possible global introduces
|
|
666
673
|
variables.
|
|
667
|
-
*/var globalNames=Object.keys(globalThis).concat("globalThis").filter(function(name){return new RegExp("^[".concat(ALLOWED_STARTING_VARIABLE_SYMBOLS,"]")+"[".concat(ALLOWED_VARIABLE_SYMBOLS,"]*$")).test(name)&&!KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS.includes(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
|
|
674
|
+
*/var globalNames=Object.keys(globalThis).concat("globalThis").filter(function(name){return new RegExp("^[".concat(ALLOWED_STARTING_VARIABLE_SYMBOLS,"]")+"[".concat(ALLOWED_VARIABLE_SYMBOLS,"]*$")).test(name)&&!KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS.includes(name)});var result={error:null,globalNames:globalNames,globalNamesUndefinedList:globalNames.map(function(){return undefined}),originalScopeNames:Array.isArray(options.scope)?options.scope:typeof options.scope==="string"?[options.scope]:Object.keys(options.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
|
|
668
675
|
}catch(err){_iterator5.e(err)}finally{_iterator5.f()}if(POLYFILL_TEMPLATE_STRINGS.value)if((_Babel=_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.Babel)!==null&&_Babel!==void 0&&_Babel.transform)expression=_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.Babel.transform("(".concat(expression,")"),{plugins:["transform-template-literals"]}).code;else if(expression.startsWith("`")&&expression.endsWith("`")){var escapeMarker="####";// Convert template string into legacy string concatenations.
|
|
669
676
|
expression=expression// Mark simple escape sequences.
|
|
670
677
|
.replace(/\\\$/g,escapeMarker)// Handle avoidable template expression: Use raw code.
|
|
@@ -676,32 +683,35 @@ var quote=expression.charAt(0)==="`"?"'":expression.charAt(0);expression=express
|
|
|
676
683
|
.replace(/\$\{((([^{]*{[^}]*}[^}]*})|[^{}]+)+)}/g,"".concat(quote,"+($1)+").concat(quote)).replace(/^`([\s\S]+)`$/,"".concat(quote,"$1").concat(quote))// Remove remaining newlines.
|
|
677
684
|
.replace(/\n+/g,"")// Replace marked escape sequences.
|
|
678
685
|
.replace(new RegExp(escapeMarker,"g"),"\\$")}// endregion
|
|
679
|
-
var innerTemplateFunction;try{// eslint-disable-next-line @typescript-eslint/no-
|
|
680
|
-
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_js__WEBPACK_IMPORTED_MODULE_3__/* .represent */ .Do)(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
|
+
var innerTemplateFunction;try{// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
687
|
+
innerTemplateFunction=_construct(options.async?AsyncFunction:Function,_toConsumableArray(options.removeGlobalScope?result.globalNames:[]).concat(_toConsumableArray(result.scopeNames),["".concat(options.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_js__WEBPACK_IMPORTED_MODULE_3__/* .represent */ .Do)(error)}if(innerTemplateFunction){var boundInnerTemplateFunction=innerTemplateFunction.bind(options.binding);result.templateFunction=options.removeGlobalScope?function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}return(/*
|
|
681
688
|
NOTE: We shadow existing global names to sandbox
|
|
682
689
|
expressions.
|
|
683
690
|
*/boundInnerTemplateFunction.apply(void 0,_toConsumableArray(result.globalNamesUndefinedList).concat(parameters)))}:boundInnerTemplateFunction}return result};/**
|
|
684
691
|
* Evaluates a given string as an expression against a given scope.
|
|
685
692
|
* @param expression - The string to interpret.
|
|
686
|
-
* @param
|
|
687
|
-
* @param
|
|
688
|
-
* @param
|
|
689
|
-
*
|
|
690
|
-
*
|
|
693
|
+
* @param givenOptions - Expression options.
|
|
694
|
+
* @param givenOptions.scope - Scope to extract names from.
|
|
695
|
+
* @param givenOptions.execute - Indicates whether to execute or evaluate.
|
|
696
|
+
* @param givenOptions.removeGlobalScope - Indicates whether to shadow global
|
|
697
|
+
* scope.
|
|
698
|
+
* @param givenOptions.binding - Object to apply as "this" in evaluation scope.
|
|
699
|
+
* @param givenOptions.async - Indicates whether to compile an async function.
|
|
691
700
|
* @returns Object with an error message during parsing / running or result.
|
|
692
|
-
*/var evaluate=function evaluate(expression,
|
|
693
|
-
var _compile=compile(expression,
|
|
701
|
+
*/var evaluate=function evaluate(expression,givenOptions){if(givenOptions===void 0){givenOptions={}}var options=_objectSpread({scope:{},async:false,execute:false,removeGlobalScope:true,binding:{}},givenOptions);// NOTE: We extract string-only types from given scope type.
|
|
702
|
+
var _compile=compile(expression,options),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 options.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_js__WEBPACK_IMPORTED_MODULE_3__/* .represent */ .Do)(error)}return result};/**
|
|
694
703
|
* Evaluates a given string as an expression against a given scope. Does same
|
|
695
704
|
* as "evaluate" but throws an exception if an error occurs and returns the
|
|
696
705
|
* evaluated value instead of an object with error and result.
|
|
697
706
|
* @param expression - The string to interpret.
|
|
698
|
-
* @param
|
|
699
|
-
* @param
|
|
700
|
-
* @param
|
|
701
|
-
*
|
|
702
|
-
* @param binding - Object to apply as "this" in evaluation scope.
|
|
707
|
+
* @param options - Expression options.
|
|
708
|
+
* @param options.scope - Scope to extract names from.
|
|
709
|
+
* @param options.execute - Indicates whether to execute or evaluate.
|
|
710
|
+
* @param options.removeGlobalScope - Indicates whether to shadow global scope.
|
|
711
|
+
* @param options.binding - Object to apply as "this" in evaluation scope.
|
|
712
|
+
* @param options.async - Indicates whether to compile an async function.
|
|
703
713
|
* @returns Object with an error message during parsing / running or result.
|
|
704
|
-
*/var evaluateOrThrowError=function evaluateOrThrowError(expression,
|
|
714
|
+
*/var evaluateOrThrowError=function evaluateOrThrowError(expression,options){if(options===void 0){options={}}var evaluated=evaluate(expression,options);if(evaluated.error)throw new Error(evaluated.error);return evaluated.result};/**
|
|
705
715
|
* Finds the string match of a given query in a given target text by applying a
|
|
706
716
|
* given normalization function to target and query.
|
|
707
717
|
* @param target - Target to search in.
|
|
@@ -764,11 +774,11 @@ distanceMatrix[firstIndex-1][secondIndex-1]+indicator)}return distanceMatrix[sec
|
|
|
764
774
|
* @param givenOptions.skipTagDelimitedParts - Indicates whether to, for
|
|
765
775
|
* example, ignore html tags via "['<', '>']" (the default).
|
|
766
776
|
* @returns Processed result.
|
|
767
|
-
*/var mark=function mark(target,givenWords,givenOptions){if(givenOptions===void 0){givenOptions={}}if(typeof target==="string"&&givenWords!==null&&givenWords!==void 0&&givenWords.length){var
|
|
777
|
+
*/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;/*
|
|
768
778
|
Search for matches as long there is enough target text remaining to
|
|
769
779
|
walk through.
|
|
770
780
|
*/for(var iteration=0;iteration<MAXIMAL_NUMBER_OF_ITERATIONS.value;iteration++){var nearestRange=null;var currentRange=void 0;// Find the nearest next matching word.
|
|
771
|
-
var _iterator7=_createForOfIteratorHelper(words),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var word=_step7.value;currentRange=findNormalizedMatchRange(restTarget,word,
|
|
781
|
+
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};/**
|
|
772
782
|
* Normalizes a given phone number for automatic dialing or comparison.
|
|
773
783
|
* @param value - Number to normalize.
|
|
774
784
|
* @param dialable - Indicates whether the result should be dialed or
|
|
@@ -801,7 +811,7 @@ normalizedValue=normalizedValue.replace(compiledPattern,replacer);else normalize
|
|
|
801
811
|
* in.
|
|
802
812
|
* @param name - The name under given scope will be available.
|
|
803
813
|
* @returns The parsed object if possible and null otherwise.
|
|
804
|
-
*/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};/**
|
|
814
|
+
*/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,{scope:_defineProperty({},name,scope)});if(_typeof(result.result)==="object")return result.result;return null};/**
|
|
805
815
|
* Represents a given phone number. NOTE: Currently only support German phone
|
|
806
816
|
* numbers.
|
|
807
817
|
* @param value - Number to format.
|
|
@@ -890,7 +900,7 @@ var DATE_TIME_PATTERN_CACHE=[];/**
|
|
|
890
900
|
*/var dateTimeFormat=function dateTimeFormat(format,dateTime,options,locales){if(format===void 0){format="full"}if(dateTime===void 0){dateTime=new Date}if(options===void 0){options={}}if(locales===void 0){locales=_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .LOCALES */ .YZ}if(typeof dateTime==="number")/*
|
|
891
901
|
NOTE: "Date" constructor expects milliseconds as unit instead
|
|
892
902
|
of more common used seconds.
|
|
893
|
-
*/dateTime*=1000;var normalizedDateTime=new Date(dateTime);if(["full","long","medium","short"].includes(format))return new Intl.DateTimeFormat([].concat(locales,"en-US"),_objectSpread({dateStyle:format,timeStyle:format},options)).format(normalizedDateTime);var scope={};var _iterator=_createForOfIteratorHelper(["full","long","medium","short"]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var style=_step.value;scope["".concat(style,"Literals")]=[];var _dateTimeFormat=new Intl.DateTimeFormat([].concat(locales,"en-US"),_objectSpread({dateStyle:style,timeStyle:style},options));scope[style]=_dateTimeFormat.format(normalizedDateTime);var _iterator2=_createForOfIteratorHelper(_dateTimeFormat.formatToParts(normalizedDateTime)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;if(item.type==="literal")scope["".concat(style,"Literals")].push(item.value);else scope["".concat(style).concat((0,_string_js__WEBPACK_IMPORTED_MODULE_2__/* .capitalize */ .ZH)(item.type))]=item.value}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var evaluated=(0,_string_js__WEBPACK_IMPORTED_MODULE_2__/* .evaluate */ ._3)("`".concat(format,"`"),scope);if(evaluated.error)throw new Error(evaluated.error);/*
|
|
903
|
+
*/dateTime*=1000;var normalizedDateTime=new Date(dateTime);if(["full","long","medium","short"].includes(format))return new Intl.DateTimeFormat([].concat(locales,"en-US"),_objectSpread({dateStyle:format,timeStyle:format},options)).format(normalizedDateTime);var scope={};var _iterator=_createForOfIteratorHelper(["full","long","medium","short"]),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var style=_step.value;scope["".concat(style,"Literals")]=[];var _dateTimeFormat=new Intl.DateTimeFormat([].concat(locales,"en-US"),_objectSpread({dateStyle:style,timeStyle:style},options));scope[style]=_dateTimeFormat.format(normalizedDateTime);var _iterator2=_createForOfIteratorHelper(_dateTimeFormat.formatToParts(normalizedDateTime)),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var item=_step2.value;if(item.type==="literal")scope["".concat(style,"Literals")].push(item.value);else scope["".concat(style).concat((0,_string_js__WEBPACK_IMPORTED_MODULE_2__/* .capitalize */ .ZH)(item.type))]=item.value}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}}}catch(err){_iterator.e(err)}finally{_iterator.f()}var evaluated=(0,_string_js__WEBPACK_IMPORTED_MODULE_2__/* .evaluate */ ._3)("`".concat(format,"`"),{scope:scope});if(evaluated.error)throw new Error(evaluated.error);/*
|
|
894
904
|
NOTE: For some reason hidden symbols are injected differently on
|
|
895
905
|
different platforms, so we have to normalize for predictable
|
|
896
906
|
testing.
|
|
@@ -936,7 +946,7 @@ value=value.replace(/^(-?)-*0*([1-9][0-9]*)$/,"$1$2");// region interpret intege
|
|
|
936
946
|
if(!DATE_TIME_PATTERN_CACHE.length){// region pre-compile regular expressions
|
|
937
947
|
/// region pattern
|
|
938
948
|
var millisecondPattern="(?<millisecond>(?:0{0,3}[0-9])|(?:0{0,2}[1-9]{2})|"+"(?:0?[1-9]{3})|(?:1[1-9]{3}))";var minuteAndSecondPattern="(?:0?[0-9])|(?:[1-5][0-9])|(?:60)";var secondPattern="(?<second>".concat(minuteAndSecondPattern,")");var minutePattern="(?<minute>".concat(minuteAndSecondPattern,")");var hourPattern="(?<hour>(?:0?[0-9])|(?:1[0-9])|(?:2[0-4]))";var noonIndicatorPattern="(?<noonIndicator> *(?:(?:a\\.?m\\.?)|(?:p\\.?m\\.?)))?";var dayPattern="(?<day>(?:0?[1-9])|(?:[1-2][0-9])|(?:3[01]))";var monthPattern="(?<month>(?:0?[1-9])|(?:1[0-2]))";var yearPattern="(?<year>(?:0?[1-9])|(?:[1-9][0-9]+))";/// endregion
|
|
939
|
-
var patternPresenceCache={};var _iterator3=_createForOfIteratorHelper(["t"," "]),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var timeDelimiter=_step3.value;var _iterator4=_createForOfIteratorHelper([":","/","-"," "]),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var timeComponentDelimiter=_step4.value;for(var _i=0,_arr=[hourPattern+"".concat(timeComponentDelimiter,"+")+minutePattern+noonIndicatorPattern,hourPattern+"".concat(timeComponentDelimiter,"+")+minutePattern+"".concat(timeComponentDelimiter,"+")+secondPattern+noonIndicatorPattern,hourPattern+"".concat(timeComponentDelimiter,"+")+minutePattern+"".concat(timeComponentDelimiter,"+")+secondPattern+"".concat(timeComponentDelimiter,"+")+millisecondPattern+noonIndicatorPattern,hourPattern+noonIndicatorPattern];_i<_arr.length;_i++){var timeFormat=_arr[_i];for(var _i2=0,_arr2=[{delimiter:["/","-"," "],pattern:[monthPattern+"${delimiter}"+dayPattern+"${delimiter}"+yearPattern,monthPattern+"${delimiter}"+dayPattern+" +"+yearPattern,yearPattern+"${delimiter}"+monthPattern+"${delimiter}"+dayPattern,yearPattern+" +"+monthPattern+"${delimiter}"+dayPattern,monthPattern+"${delimiter}"+dayPattern+"${delimiter}"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,monthPattern+"${delimiter}"+dayPattern+" +"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+monthPattern+"${delimiter}"+dayPattern+"${delimiter}"+yearPattern,timeFormat+"".concat(timeDelimiter,"+")+monthPattern+"${delimiter}"+dayPattern+" +"+yearPattern,yearPattern+"${delimiter}"+monthPattern+"${delimiter}"+dayPattern+"".concat(timeDelimiter,"+")+timeFormat,yearPattern+" +"+monthPattern+"${delimiter}"+dayPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+"${delimiter}"+monthPattern+"${delimiter}"+dayPattern,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+" +"+monthPattern+"${delimiter}"+dayPattern]},{delimiter:"\\.",pattern:[dayPattern+"${delimiter}"+monthPattern+"${delimiter}"+yearPattern,dayPattern+"${delimiter}"+monthPattern+" +"+yearPattern,yearPattern+"${delimiter}"+dayPattern+"${delimiter}"+monthPattern,yearPattern+" +"+dayPattern+"${delimiter}"+monthPattern,dayPattern+"${delimiter}"+monthPattern+"${delimiter}"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,dayPattern+"${delimiter}"+monthPattern+" +"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+dayPattern+"${delimiter}"+monthPattern+"${delimiter}"+yearPattern,timeFormat+"".concat(timeDelimiter,"+")+dayPattern+"${delimiter}"+monthPattern+" +"+yearPattern,yearPattern+"${delimiter}"+dayPattern+"${delimiter}"+monthPattern+"".concat(timeDelimiter,"+")+timeFormat,yearPattern+" +"+dayPattern+"${delimiter}"+monthPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+"${delimiter}"+dayPattern+"${delimiter}"+monthPattern,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+" +"+dayPattern+"${delimiter}"+monthPattern]},{pattern:timeFormat}];_i2<_arr2.length;_i2++){var _dateTimeFormat2=_arr2[_i2];var _iterator5=_createForOfIteratorHelper([].concat(Object.prototype.hasOwnProperty.call(_dateTimeFormat2,"delimiter")?_dateTimeFormat2.delimiter:"-")),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var delimiter=_step5.value;var _iterator6=_createForOfIteratorHelper([].concat(_dateTimeFormat2.pattern)),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _pattern=_step6.value;var evaluatedPattern=(0,_string_js__WEBPACK_IMPORTED_MODULE_2__/* .evaluate */ ._3)("`^".concat(_pattern,"$`"),{delimiter:"".concat(delimiter,"+")}).result;if(evaluatedPattern&&!Object.prototype.hasOwnProperty.call(patternPresenceCache,evaluatedPattern)){patternPresenceCache[evaluatedPattern]=true;DATE_TIME_PATTERN_CACHE.push(new RegExp(evaluatedPattern))}}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}}}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}// endregion
|
|
949
|
+
var patternPresenceCache={};var _iterator3=_createForOfIteratorHelper(["t"," "]),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var timeDelimiter=_step3.value;var _iterator4=_createForOfIteratorHelper([":","/","-"," "]),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var timeComponentDelimiter=_step4.value;for(var _i=0,_arr=[hourPattern+"".concat(timeComponentDelimiter,"+")+minutePattern+noonIndicatorPattern,hourPattern+"".concat(timeComponentDelimiter,"+")+minutePattern+"".concat(timeComponentDelimiter,"+")+secondPattern+noonIndicatorPattern,hourPattern+"".concat(timeComponentDelimiter,"+")+minutePattern+"".concat(timeComponentDelimiter,"+")+secondPattern+"".concat(timeComponentDelimiter,"+")+millisecondPattern+noonIndicatorPattern,hourPattern+noonIndicatorPattern];_i<_arr.length;_i++){var timeFormat=_arr[_i];for(var _i2=0,_arr2=[{delimiter:["/","-"," "],pattern:[monthPattern+"${delimiter}"+dayPattern+"${delimiter}"+yearPattern,monthPattern+"${delimiter}"+dayPattern+" +"+yearPattern,yearPattern+"${delimiter}"+monthPattern+"${delimiter}"+dayPattern,yearPattern+" +"+monthPattern+"${delimiter}"+dayPattern,monthPattern+"${delimiter}"+dayPattern+"${delimiter}"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,monthPattern+"${delimiter}"+dayPattern+" +"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+monthPattern+"${delimiter}"+dayPattern+"${delimiter}"+yearPattern,timeFormat+"".concat(timeDelimiter,"+")+monthPattern+"${delimiter}"+dayPattern+" +"+yearPattern,yearPattern+"${delimiter}"+monthPattern+"${delimiter}"+dayPattern+"".concat(timeDelimiter,"+")+timeFormat,yearPattern+" +"+monthPattern+"${delimiter}"+dayPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+"${delimiter}"+monthPattern+"${delimiter}"+dayPattern,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+" +"+monthPattern+"${delimiter}"+dayPattern]},{delimiter:"\\.",pattern:[dayPattern+"${delimiter}"+monthPattern+"${delimiter}"+yearPattern,dayPattern+"${delimiter}"+monthPattern+" +"+yearPattern,yearPattern+"${delimiter}"+dayPattern+"${delimiter}"+monthPattern,yearPattern+" +"+dayPattern+"${delimiter}"+monthPattern,dayPattern+"${delimiter}"+monthPattern+"${delimiter}"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,dayPattern+"${delimiter}"+monthPattern+" +"+yearPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+dayPattern+"${delimiter}"+monthPattern+"${delimiter}"+yearPattern,timeFormat+"".concat(timeDelimiter,"+")+dayPattern+"${delimiter}"+monthPattern+" +"+yearPattern,yearPattern+"${delimiter}"+dayPattern+"${delimiter}"+monthPattern+"".concat(timeDelimiter,"+")+timeFormat,yearPattern+" +"+dayPattern+"${delimiter}"+monthPattern+"".concat(timeDelimiter,"+")+timeFormat,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+"${delimiter}"+dayPattern+"${delimiter}"+monthPattern,timeFormat+"".concat(timeDelimiter,"+")+yearPattern+" +"+dayPattern+"${delimiter}"+monthPattern]},{pattern:timeFormat}];_i2<_arr2.length;_i2++){var _dateTimeFormat2=_arr2[_i2];var _iterator5=_createForOfIteratorHelper([].concat(Object.prototype.hasOwnProperty.call(_dateTimeFormat2,"delimiter")?_dateTimeFormat2.delimiter:"-")),_step5;try{for(_iterator5.s();!(_step5=_iterator5.n()).done;){var delimiter=_step5.value;var _iterator6=_createForOfIteratorHelper([].concat(_dateTimeFormat2.pattern)),_step6;try{for(_iterator6.s();!(_step6=_iterator6.n()).done;){var _pattern=_step6.value;var evaluatedPattern=(0,_string_js__WEBPACK_IMPORTED_MODULE_2__/* .evaluate */ ._3)("`^".concat(_pattern,"$`"),{scope:{delimiter:"".concat(delimiter,"+")}}).result;if(evaluatedPattern&&!Object.prototype.hasOwnProperty.call(patternPresenceCache,evaluatedPattern)){patternPresenceCache[evaluatedPattern]=true;DATE_TIME_PATTERN_CACHE.push(new RegExp(evaluatedPattern))}}}catch(err){_iterator6.e(err)}finally{_iterator6.f()}}}catch(err){_iterator5.e(err)}finally{_iterator5.f()}}}}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}// endregion
|
|
940
950
|
}catch(err){_iterator3.e(err)}finally{_iterator3.f()}}// region pre-process
|
|
941
951
|
// NOTE: All patterns can assume lower cased strings.
|
|
942
952
|
value=value.toLowerCase();/*
|
|
@@ -205,7 +205,11 @@ for(var _i6=0,_Array$from=Array.from(domNode.childNodes);_i6<_Array$from.length;
|
|
|
205
205
|
* @param value - Value to check.
|
|
206
206
|
* @returns Value "true" if given object is a plain javaScript object and
|
|
207
207
|
* "false" otherwise.
|
|
208
|
-
*/var isPlainObject=function isPlainObject(value){
|
|
208
|
+
*/var isPlainObject=function isPlainObject(value){var _prototype$constructo;if(!isObject(value))return false;var prototype=Object.getPrototypeOf(value);if(PLAIN_OBJECT_PROTOTYPES.includes(prototype))return true;/*
|
|
209
|
+
NOTE: Plain objects created in another realm (a vm context like used by
|
|
210
|
+
test runners or a worker for example) have their own "Object.prototype"
|
|
211
|
+
instance and would not be recognized by the identity check above.
|
|
212
|
+
*/return prototype!==null&&Object.getPrototypeOf(prototype)===null&&((_prototype$constructo=prototype.constructor)===null||_prototype$constructo===void 0?void 0:_prototype$constructo.name)==="Object"};/**
|
|
209
213
|
* Checks whether given object is a set.
|
|
210
214
|
* @param value - Value to check.
|
|
211
215
|
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
@@ -227,7 +227,7 @@ if(options.deep!==0){var result=_equals(value,second[key],_objectSpread(_objectS
|
|
|
227
227
|
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
228
228
|
* a value to evaluate.
|
|
229
229
|
* @returns Evaluated given mapping.
|
|
230
|
-
*/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_js__WEBPACK_IMPORTED_MODULE_5__/* .evaluateOrThrowError */ .VK)(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_js__WEBPACK_IMPORTED_MODULE_3__/* .isObject */ .Gv)(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
230
|
+
*/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_js__WEBPACK_IMPORTED_MODULE_5__/* .evaluateOrThrowError */ .VK)(code,{scope:options.scope,async:false,execute: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_js__WEBPACK_IMPORTED_MODULE_3__/* .isObject */ .Gv)(givenValue)){var value=givenValue;_addProxyRecursively(value);// NOTE: We only wrap needed objects for performance reasons.
|
|
231
231
|
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")/*
|
|
232
232
|
eslint-disable
|
|
233
233
|
@typescript-eslint/unbound-method
|
|
@@ -255,7 +255,7 @@ for(var _i18=0,_arr9=[options.expressionIndicatorKey,options.executionIndicatorK
|
|
|
255
255
|
* @param givenOptions.executionIndicatorKey - Indicator property name to mark
|
|
256
256
|
* a value to evaluate.
|
|
257
257
|
* @returns Evaluated given mapping.
|
|
258
|
-
*/var _evaluateAsyncDynamicData=/*#__PURE__*/function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,index,_iterator16,_step16,item,_i21,_Object$entries1,_Object$entries1$_i,key,value,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_3__/* .isObject */ .Gv)(data)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;if(!Array.isArray(data)){_context.n=10;break}index=0;_iterator16=_createForOfIteratorHelper(data);_context.p=2;_iterator16.s();case 3:if((_step16=_iterator16.n()).done){_context.n=6;break}item=_step16.value;_context.n=4;return _evaluateAsyncDynamicData(item,options);case 4:result[index]=_context.v;index+=1;case 5:_context.n=3;break;case 6:_context.n=8;break;case 7:_context.p=7;_t=_context.v;_iterator16.e(_t);case 8:_context.p=8;_iterator16.f();return _context.f(8);case 9:return _context.a(2,result);case 10:_i21=0,_Object$entries1=Object.entries(data);case 11:if(!(_i21<_Object$entries1.length)){_context.n=16;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=13;break}_context.n=12;return (0,_string_js__WEBPACK_IMPORTED_MODULE_5__/* .evaluateOrThrowError */ .VK)(value,options.scope,key===options.executionIndicatorKey);case 12:return _context.a(2,_context.v);case 13:_context.n=14;return _evaluateAsyncDynamicData(value,options);case 14:result[key]=_context.v;case 15:_i21++;_context.n=11;break;case 16:return _context.a(2,result)}},_callee,null,[[2,7,8,9]])}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}();/**
|
|
258
|
+
*/var _evaluateAsyncDynamicData=/*#__PURE__*/function(){var _evaluateAsyncDynamicData2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(data,givenOptions){var options,result,index,_iterator16,_step16,item,_i21,_Object$entries1,_Object$entries1$_i,key,value,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(givenOptions===void 0){givenOptions={}}options=_objectSpread({scope:{},selfReferenceName:"self",expressionIndicatorKey:"__await_evaluate__",executionIndicatorKey:"__await_execute__"},givenOptions);if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_3__/* .isObject */ .Gv)(data)){_context.n=1;break}return _context.a(2,data);case 1:if(!(options.selfReferenceName in options.scope))options.scope[options.selfReferenceName]=data;result=data;if(!Array.isArray(data)){_context.n=10;break}index=0;_iterator16=_createForOfIteratorHelper(data);_context.p=2;_iterator16.s();case 3:if((_step16=_iterator16.n()).done){_context.n=6;break}item=_step16.value;_context.n=4;return _evaluateAsyncDynamicData(item,options);case 4:result[index]=_context.v;index+=1;case 5:_context.n=3;break;case 6:_context.n=8;break;case 7:_context.p=7;_t=_context.v;_iterator16.e(_t);case 8:_context.p=8;_iterator16.f();return _context.f(8);case 9:return _context.a(2,result);case 10:_i21=0,_Object$entries1=Object.entries(data);case 11:if(!(_i21<_Object$entries1.length)){_context.n=16;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=13;break}_context.n=12;return (0,_string_js__WEBPACK_IMPORTED_MODULE_5__/* .evaluateOrThrowError */ .VK)(value,{scope:options.scope,async:true,execute:key===options.executionIndicatorKey});case 12:return _context.a(2,_context.v);case 13:_context.n=14;return _evaluateAsyncDynamicData(value,options);case 14:result[key]=_context.v;case 15:_i21++;_context.n=11;break;case 16:return _context.a(2,result)}},_callee,null,[[2,7,8,9]])}));function evaluateAsyncDynamicData(_x,_x2){return _evaluateAsyncDynamicData2.apply(this,arguments)}return evaluateAsyncDynamicData}();/**
|
|
259
259
|
* Removes properties in objects where a dynamic indicator lives.
|
|
260
260
|
* @param data - Object to traverse recursively.
|
|
261
261
|
* @param expressionIndicators - Property key to remove.
|
|
@@ -404,7 +404,11 @@ result=object;if((0,_indicators_js__WEBPACK_IMPORTED_MODULE_3__/* .isPlainObject
|
|
|
404
404
|
* @param value - Value to check.
|
|
405
405
|
* @returns Value "true" if given object is a plain javaScript object and
|
|
406
406
|
* "false" otherwise.
|
|
407
|
-
*/var isPlainObject=function isPlainObject(value){
|
|
407
|
+
*/var isPlainObject=function isPlainObject(value){var _prototype$constructo;if(!isObject(value))return false;var prototype=Object.getPrototypeOf(value);if(_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .PLAIN_OBJECT_PROTOTYPES */ .jE.includes(prototype))return true;/*
|
|
408
|
+
NOTE: Plain objects created in another realm (a vm context like used by
|
|
409
|
+
test runners or a worker for example) have their own "Object.prototype"
|
|
410
|
+
instance and would not be recognized by the identity check above.
|
|
411
|
+
*/return prototype!==null&&Object.getPrototypeOf(prototype)===null&&((_prototype$constructo=prototype.constructor)===null||_prototype$constructo===void 0?void 0:_prototype$constructo.name)==="Object"};/**
|
|
408
412
|
* Checks whether given object is a set.
|
|
409
413
|
* @param value - Value to check.
|
|
410
414
|
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
@@ -475,7 +479,7 @@ module.exports = webpackEmptyContext;
|
|
|
475
479
|
/* harmony export */ VK: function() { return /* binding */ evaluateOrThrowError; },
|
|
476
480
|
/* harmony export */ jt: function() { return /* binding */ escapeRegularExpressions; }
|
|
477
481
|
/* harmony export */ });
|
|
478
|
-
/* unused harmony exports KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS, 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 */
|
|
482
|
+
/* unused harmony exports KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS, POLYFILL_TEMPLATE_STRINGS, ALLOWED_VARIABLE_SYMBOLS, ALLOWED_STARTING_VARIABLE_SYMBOLS, FIX_ENCODING_ERROR_MAPPING, AsyncFunction, 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 */
|
|
479
483
|
/* unused harmony import specifier */ var ABBREVIATIONS;
|
|
480
484
|
/* unused harmony import specifier */ var DEFAULT_ENCODING;
|
|
481
485
|
/* unused harmony import specifier */ var globalContext;
|
|
@@ -503,12 +507,13 @@ module.exports = webpackEmptyContext;
|
|
|
503
507
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
504
508
|
endregion
|
|
505
509
|
*/// region imports
|
|
506
|
-
function _defaults(e,r){for(var t=Object.getOwnPropertyNames(r),o=0;o<t.length;o++){var n=t[o],a=Object.getOwnPropertyDescriptor(r,n);a&&a.configurable&&void 0===e[n]&&Object.defineProperty(e,n,a)}return e}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
|
|
510
|
+
function _defaults(e,r){for(var t=Object.getOwnPropertyNames(r),o=0;o<t.length;o++){var n=t[o],a=Object.getOwnPropertyDescriptor(r,n);a&&a.configurable&&void 0===e[n]&&Object.defineProperty(e,n,a)}return e}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 _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 _defaults(t,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 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 _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 _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):(_defaults(e,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)})}};// endregion
|
|
507
511
|
var KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS=["default","if","for","class","function","return","const","let","var"];var POLYFILL_TEMPLATE_STRINGS={value:false};// Partial regular expression matching symbols which should be allowed within a
|
|
508
512
|
// variable name excluding the first character.
|
|
509
513
|
var ALLOWED_VARIABLE_SYMBOLS="0-9a-zA-Z_$";// Partial regular expression matching symbols which should be allowed as
|
|
510
514
|
// starting character for a variable name.
|
|
511
|
-
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"]]))
|
|
515
|
+
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"]]));var AsyncFunction=// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
516
|
+
Object.getPrototypeOf(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){return _regenerator().w(function(_context){while(1)switch(_context.n){case 0:return _context.a(2)}},_callee)}))).constructor;/**
|
|
512
517
|
* Translates a given string into the regular expression validated
|
|
513
518
|
* representation.
|
|
514
519
|
* @param value - String to convert.
|
|
@@ -651,18 +656,20 @@ var parameters=[];var _iterator2=_createForOfIteratorHelper(data),_step2;try{for
|
|
|
651
656
|
*/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};/**
|
|
652
657
|
* Compiles a given string as an expression with given scope names.
|
|
653
658
|
* @param expression - The string to interpret.
|
|
654
|
-
* @param
|
|
655
|
-
* @param
|
|
656
|
-
* @param
|
|
657
|
-
*
|
|
658
|
-
*
|
|
659
|
+
* @param givenOptions - Expression options.
|
|
660
|
+
* @param givenOptions.scope - Scope to extract names from.
|
|
661
|
+
* @param givenOptions.execute - Indicates whether to execute or evaluate.
|
|
662
|
+
* @param givenOptions.removeGlobalScope - Indicates whether to shadow global
|
|
663
|
+
* scope.
|
|
664
|
+
* @param givenOptions.binding - Object to apply as "this" in evaluation scope.
|
|
665
|
+
* @param givenOptions.async - Indicates whether to compile an async function.
|
|
659
666
|
* @returns Object of prepared scope name mappings and compiled function or
|
|
660
667
|
* error string message if given expression couldn't be compiled.
|
|
661
|
-
*/var compile=function compile(expression,
|
|
668
|
+
*/var compile=function compile(expression,givenOptions){var _Babel;if(givenOptions===void 0){givenOptions={}}var options=_objectSpread({scope:[],async:false,execute:false,removeGlobalScope:true,binding:{}},givenOptions);/*
|
|
662
669
|
NOTE: We do this global variable name determining as close as possible
|
|
663
670
|
to the compiling step to cover as much as possible global introduces
|
|
664
671
|
variables.
|
|
665
|
-
*/var globalNames=Object.keys(globalThis).concat("globalThis").filter(function(name){return new RegExp("^[".concat(ALLOWED_STARTING_VARIABLE_SYMBOLS,"]")+"[".concat(ALLOWED_VARIABLE_SYMBOLS,"]*$")).test(name)&&!KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS.includes(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
|
|
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)&&!KNOWN_DISALLOWED_VARIABLE_NAMES_BUT_OBJECT_KEYS.includes(name)});var result={error:null,globalNames:globalNames,globalNamesUndefinedList:globalNames.map(function(){return undefined}),originalScopeNames:Array.isArray(options.scope)?options.scope:typeof options.scope==="string"?[options.scope]:Object.keys(options.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
|
|
666
673
|
}catch(err){_iterator5.e(err)}finally{_iterator5.f()}if(POLYFILL_TEMPLATE_STRINGS.value)if((_Babel=_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.Babel)!==null&&_Babel!==void 0&&_Babel.transform)expression=_context_js__WEBPACK_IMPORTED_MODULE_2__/* .globalContext */ .Lz.Babel.transform("(".concat(expression,")"),{plugins:["transform-template-literals"]}).code;else if(expression.startsWith("`")&&expression.endsWith("`")){var escapeMarker="####";// Convert template string into legacy string concatenations.
|
|
667
674
|
expression=expression// Mark simple escape sequences.
|
|
668
675
|
.replace(/\\\$/g,escapeMarker)// Handle avoidable template expression: Use raw code.
|
|
@@ -674,32 +681,35 @@ var quote=expression.charAt(0)==="`"?"'":expression.charAt(0);expression=express
|
|
|
674
681
|
.replace(/\$\{((([^{]*{[^}]*}[^}]*})|[^{}]+)+)}/g,"".concat(quote,"+($1)+").concat(quote)).replace(/^`([\s\S]+)`$/,"".concat(quote,"$1").concat(quote))// Remove remaining newlines.
|
|
675
682
|
.replace(/\n+/g,"")// Replace marked escape sequences.
|
|
676
683
|
.replace(new RegExp(escapeMarker,"g"),"\\$")}// endregion
|
|
677
|
-
var innerTemplateFunction;try{// eslint-disable-next-line @typescript-eslint/no-
|
|
678
|
-
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_js__WEBPACK_IMPORTED_MODULE_3__/* .represent */ .Do)(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(/*
|
|
684
|
+
var innerTemplateFunction;try{// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
685
|
+
innerTemplateFunction=_construct(options.async?AsyncFunction:Function,_toConsumableArray(options.removeGlobalScope?result.globalNames:[]).concat(_toConsumableArray(result.scopeNames),["".concat(options.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_js__WEBPACK_IMPORTED_MODULE_3__/* .represent */ .Do)(error)}if(innerTemplateFunction){var boundInnerTemplateFunction=innerTemplateFunction.bind(options.binding);result.templateFunction=options.removeGlobalScope?function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}return(/*
|
|
679
686
|
NOTE: We shadow existing global names to sandbox
|
|
680
687
|
expressions.
|
|
681
688
|
*/boundInnerTemplateFunction.apply(void 0,_toConsumableArray(result.globalNamesUndefinedList).concat(parameters)))}:boundInnerTemplateFunction}return result};/**
|
|
682
689
|
* Evaluates a given string as an expression against a given scope.
|
|
683
690
|
* @param expression - The string to interpret.
|
|
684
|
-
* @param
|
|
685
|
-
* @param
|
|
686
|
-
* @param
|
|
687
|
-
*
|
|
688
|
-
*
|
|
691
|
+
* @param givenOptions - Expression options.
|
|
692
|
+
* @param givenOptions.scope - Scope to extract names from.
|
|
693
|
+
* @param givenOptions.execute - Indicates whether to execute or evaluate.
|
|
694
|
+
* @param givenOptions.removeGlobalScope - Indicates whether to shadow global
|
|
695
|
+
* scope.
|
|
696
|
+
* @param givenOptions.binding - Object to apply as "this" in evaluation scope.
|
|
697
|
+
* @param givenOptions.async - Indicates whether to compile an async function.
|
|
689
698
|
* @returns Object with an error message during parsing / running or result.
|
|
690
|
-
*/var evaluate=function evaluate(expression,
|
|
691
|
-
var _compile=compile(expression,
|
|
699
|
+
*/var evaluate=function evaluate(expression,givenOptions){if(givenOptions===void 0){givenOptions={}}var options=_objectSpread({scope:{},async:false,execute:false,removeGlobalScope:true,binding:{}},givenOptions);// NOTE: We extract string-only types from given scope type.
|
|
700
|
+
var _compile=compile(expression,options),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 options.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_js__WEBPACK_IMPORTED_MODULE_3__/* .represent */ .Do)(error)}return result};/**
|
|
692
701
|
* Evaluates a given string as an expression against a given scope. Does same
|
|
693
702
|
* as "evaluate" but throws an exception if an error occurs and returns the
|
|
694
703
|
* evaluated value instead of an object with error and result.
|
|
695
704
|
* @param expression - The string to interpret.
|
|
696
|
-
* @param
|
|
697
|
-
* @param
|
|
698
|
-
* @param
|
|
699
|
-
*
|
|
700
|
-
* @param binding - Object to apply as "this" in evaluation scope.
|
|
705
|
+
* @param options - Expression options.
|
|
706
|
+
* @param options.scope - Scope to extract names from.
|
|
707
|
+
* @param options.execute - Indicates whether to execute or evaluate.
|
|
708
|
+
* @param options.removeGlobalScope - Indicates whether to shadow global scope.
|
|
709
|
+
* @param options.binding - Object to apply as "this" in evaluation scope.
|
|
710
|
+
* @param options.async - Indicates whether to compile an async function.
|
|
701
711
|
* @returns Object with an error message during parsing / running or result.
|
|
702
|
-
*/var evaluateOrThrowError=function evaluateOrThrowError(expression,
|
|
712
|
+
*/var evaluateOrThrowError=function evaluateOrThrowError(expression,options){if(options===void 0){options={}}var evaluated=evaluate(expression,options);if(evaluated.error)throw new Error(evaluated.error);return evaluated.result};/**
|
|
703
713
|
* Finds the string match of a given query in a given target text by applying a
|
|
704
714
|
* given normalization function to target and query.
|
|
705
715
|
* @param target - Target to search in.
|
|
@@ -762,11 +772,11 @@ distanceMatrix[firstIndex-1][secondIndex-1]+indicator)}return distanceMatrix[sec
|
|
|
762
772
|
* @param givenOptions.skipTagDelimitedParts - Indicates whether to, for
|
|
763
773
|
* example, ignore html tags via "['<', '>']" (the default).
|
|
764
774
|
* @returns Processed result.
|
|
765
|
-
*/var mark=function mark(target,givenWords,givenOptions){if(givenOptions===void 0){givenOptions={}}if(typeof target==="string"&&givenWords!==null&&givenWords!==void 0&&givenWords.length){var
|
|
775
|
+
*/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;/*
|
|
766
776
|
Search for matches as long there is enough target text remaining to
|
|
767
777
|
walk through.
|
|
768
778
|
*/for(var iteration=0;iteration<MAXIMAL_NUMBER_OF_ITERATIONS.value;iteration++){var nearestRange=null;var currentRange=void 0;// Find the nearest next matching word.
|
|
769
|
-
var _iterator7=_createForOfIteratorHelper(words),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var word=_step7.value;currentRange=findNormalizedMatchRange(restTarget,word,
|
|
779
|
+
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};/**
|
|
770
780
|
* Normalizes a given phone number for automatic dialing or comparison.
|
|
771
781
|
* @param value - Number to normalize.
|
|
772
782
|
* @param dialable - Indicates whether the result should be dialed or
|
|
@@ -799,7 +809,7 @@ normalizedValue=normalizedValue.replace(compiledPattern,replacer);else normalize
|
|
|
799
809
|
* in.
|
|
800
810
|
* @param name - The name under given scope will be available.
|
|
801
811
|
* @returns The parsed object if possible and null otherwise.
|
|
802
|
-
*/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};/**
|
|
812
|
+
*/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,{scope:_defineProperty({},name,scope)});if(_typeof(result.result)==="object")return result.result;return null};/**
|
|
803
813
|
* Represents a given phone number. NOTE: Currently only support German phone
|
|
804
814
|
* numbers.
|
|
805
815
|
* @param value - Number to format.
|