clientnode 4.0.1441 → 4.0.1443
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Lock.d.ts +39 -0
- package/dist/Lock.js +69 -83
- package/dist/Logger.d.ts +102 -0
- package/dist/Logger.js +756 -163
- package/dist/Semaphore.d.ts +29 -0
- package/dist/Semaphore.js +56 -46
- package/dist/array.d.ts +150 -0
- package/dist/array.js +661 -337
- package/dist/bundle/Lock.js +86 -0
- package/dist/bundle/Logger.js +778 -0
- package/dist/bundle/Semaphore.js +75 -0
- package/dist/bundle/array.js +776 -0
- package/dist/bundle/cli.js +59 -0
- package/dist/bundle/constants.js +214 -0
- package/dist/bundle/context.js +280 -0
- package/dist/bundle/cookie.js +301 -0
- package/dist/bundle/data-transfer.js +825 -0
- package/dist/bundle/datetime.js +1148 -0
- package/dist/bundle/domNode.js +549 -0
- package/dist/bundle/expression/evaluators.js +1228 -0
- package/dist/bundle/expression/helper.js +117 -0
- package/dist/bundle/expression/index.js +1357 -0
- package/dist/bundle/expression/indicator-functions.js +332 -0
- package/dist/bundle/expression/type.js +16 -0
- package/dist/bundle/filesystem.js +436 -0
- package/dist/bundle/function.js +117 -0
- package/dist/bundle/index.js +3249 -0
- package/dist/bundle/indicators.js +565 -0
- package/dist/bundle/module.js +213 -0
- package/dist/bundle/number.js +527 -0
- package/dist/bundle/object.js +1104 -0
- package/dist/bundle/process.js +291 -0
- package/dist/bundle/property-types.js +36 -0
- package/dist/bundle/scope.js +2121 -0
- package/dist/bundle/string.js +1213 -0
- package/dist/bundle/test-helper.js +802 -0
- package/dist/bundle/type.js +16 -0
- package/dist/bundle/utility.js +420 -0
- package/dist/cli.d.ts +31 -0
- package/dist/cli.js +45 -37
- package/dist/compatible/Lock.js +86 -0
- package/dist/compatible/Logger.js +778 -0
- package/dist/compatible/Semaphore.js +75 -0
- package/dist/compatible/array.js +776 -0
- package/dist/compatible/cli.js +59 -0
- package/dist/compatible/constants.js +214 -0
- package/dist/compatible/context.js +280 -0
- package/dist/compatible/cookie.js +301 -0
- package/dist/compatible/data-transfer.js +825 -0
- package/dist/compatible/datetime.js +1148 -0
- package/dist/compatible/domNode.js +549 -0
- package/dist/compatible/expression/evaluators.js +1228 -0
- package/dist/compatible/expression/helper.js +117 -0
- package/dist/compatible/expression/index.js +1357 -0
- package/dist/compatible/expression/indicator-functions.js +332 -0
- package/dist/compatible/expression/type.js +16 -0
- package/dist/compatible/filesystem.js +436 -0
- package/dist/compatible/function.js +117 -0
- package/dist/compatible/index.js +3249 -0
- package/dist/compatible/indicators.js +565 -0
- package/dist/compatible/module.js +213 -0
- package/dist/compatible/number.js +527 -0
- package/dist/compatible/object.js +1104 -0
- package/dist/compatible/process.js +291 -0
- package/dist/compatible/property-types.js +36 -0
- package/dist/compatible/scope.js +2121 -0
- package/dist/compatible/string.js +1213 -0
- package/dist/compatible/test-helper.js +802 -0
- package/dist/compatible/type.js +16 -0
- package/dist/compatible/utility.js +420 -0
- package/dist/constants.d.ts +99 -0
- package/dist/constants.js +198 -110
- package/dist/context.d.ts +8 -0
- package/dist/context.js +265 -25
- package/dist/cookie.d.ts +31 -0
- package/dist/cookie.js +265 -48
- package/dist/data-transfer.d.ts +45 -0
- package/dist/data-transfer.js +775 -166
- package/dist/datetime.d.ts +37 -0
- package/dist/datetime.js +1107 -241
- package/dist/domNode.d.ts +82 -0
- package/dist/domNode.js +495 -277
- package/dist/expression/evaluators.d.ts +55 -0
- package/dist/expression/evaluators.js +1189 -234
- package/dist/expression/helper.d.ts +4 -0
- package/dist/expression/helper.js +102 -82
- package/dist/expression/index.d.ts +7 -0
- package/dist/expression/index.js +1341 -10
- package/dist/expression/indicator-functions.d.ts +14 -0
- package/dist/expression/indicator-functions.js +316 -21
- package/dist/expression/type.d.ts +70 -0
- package/dist/expression/type.js +1 -5
- package/dist/filesystem.d.ts +143 -0
- package/dist/filesystem.js +349 -323
- package/dist/function.d.ts +20 -0
- package/dist/function.js +93 -51
- package/dist/index.d.ts +23 -0
- package/dist/index.js +3232 -26
- package/dist/indicators.d.ts +68 -0
- package/dist/indicators.js +512 -68
- package/dist/module.d.ts +8 -0
- package/dist/module.js +197 -99
- package/dist/number.d.ts +35 -0
- package/dist/number.js +491 -25
- package/dist/object.d.ts +231 -0
- package/dist/object.js +917 -775
- package/dist/process.d.ts +22 -0
- package/dist/process.js +261 -38
- package/dist/property-types.d.ts +460 -0
- package/dist/property-types.js +17 -96
- package/dist/scope.d.ts +44 -0
- package/dist/scope.js +2092 -56
- package/dist/string.d.ts +312 -0
- package/dist/string.js +991 -603
- package/dist/test/Lock.d.ts +1 -0
- package/dist/test/Logger.d.ts +1 -0
- package/dist/test/Semaphore.d.ts +1 -0
- package/dist/test/array.d.ts +1 -0
- package/dist/test/cookie.d.ts +1 -0
- package/dist/test/data-transfer.d.ts +1 -0
- package/dist/test/datetime.d.ts +1 -0
- package/dist/test/domNode.d.ts +1 -0
- package/dist/test/expression/evaluators.d.ts +1 -0
- package/dist/test/expression/helper.d.ts +1 -0
- package/dist/test/expression/indicator-functions.d.ts +1 -0
- package/dist/test/filesystem.d.ts +1 -0
- package/dist/test/function.d.ts +1 -0
- package/dist/test/indicators.d.ts +1 -0
- package/dist/test/number.d.ts +1 -0
- package/dist/test/object.d.ts +1 -0
- package/dist/test/process.d.ts +1 -0
- package/dist/test/property-types.d.ts +1 -0
- package/dist/test/scope.d.ts +1 -0
- package/dist/test/string.d.ts +1 -0
- package/dist/test/utility.d.ts +1 -0
- package/dist/test-helper.d.ts +143 -0
- package/dist/test-helper.js +633 -171
- package/dist/type.d.ts +230 -0
- package/dist/type.js +4 -9
- package/dist/utility.d.ts +44 -0
- package/dist/utility.js +372 -91
- package/package.json +3 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BasicScopeType, AndExpression, OrExpression, ConcatExpression, MappingExpression, Expression, IfExpression, SwitchExpression, Operation, UnaryOperation, Condition, SelectorExpression, ArrayContainsExpression } from './type';
|
|
2
|
+
export declare const isSpecificExpression: (expression: Expression, indicatorKey: string, properties?: Array<string>) => boolean;
|
|
3
|
+
export declare const isCondition: (expression: Expression) => expression is Condition;
|
|
4
|
+
export declare const isAndExpression: (expression: Expression) => expression is AndExpression;
|
|
5
|
+
export declare const isOrExpression: (expression: Expression) => expression is OrExpression;
|
|
6
|
+
export declare const isConcatExpression: (expression: Expression) => expression is ConcatExpression;
|
|
7
|
+
export declare const isMappingExpression: (expression: Expression) => expression is MappingExpression;
|
|
8
|
+
export declare const isOperation: (expression: Expression) => expression is Operation;
|
|
9
|
+
export declare const isUnaryOperation: (expression: Expression) => expression is UnaryOperation;
|
|
10
|
+
export declare const isIfExpression: <Type>(expression: Expression<Type>) => expression is IfExpression<Type>;
|
|
11
|
+
export declare const isSwitchExpression: <Type>(expression: Expression<Type>) => expression is SwitchExpression<Type>;
|
|
12
|
+
export declare const isSelector: <Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>) => expression is SelectorExpression<ScopeType>;
|
|
13
|
+
export declare const isArrayContainsExpression: <Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>) => expression is ArrayContainsExpression;
|
|
14
|
+
export declare const isValue: <Type, ScopeType extends BasicScopeType>(expression: Expression<Type, ScopeType>) => expression is Type;
|
|
@@ -1,7 +1,75 @@
|
|
|
1
|
+
if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;import * as __WEBPACK_EXTERNAL_MODULE_core_js_modules_es_array_includes_js_66c3fd7d__ from "core-js/modules/es.array.includes.js";
|
|
2
|
+
/******/ var __webpack_modules__ = ({
|
|
3
|
+
|
|
4
|
+
/***/ 0:
|
|
5
|
+
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
var x = function(y) {
|
|
8
|
+
var x = {}; __webpack_require__.d(x, y); return x
|
|
9
|
+
}
|
|
10
|
+
var y = function(x) { return function() { return x; }; }
|
|
11
|
+
module.exports = x({ });
|
|
12
|
+
|
|
13
|
+
/***/ }),
|
|
14
|
+
|
|
15
|
+
/***/ 1:
|
|
16
|
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
17
|
+
|
|
18
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19
|
+
/* harmony export */ jE: function() { return /* binding */ PLAIN_OBJECT_PROTOTYPES; }
|
|
20
|
+
/* harmony export */ });
|
|
21
|
+
/* unused harmony exports DEFAULT_ENCODING, CLOSE_EVENT_NAMES, CONSOLE_METHODS, VALUE_COPY_SYMBOL, IGNORE_NULL_AND_UNDEFINED_SYMBOL, ABBREVIATIONS, ANIMATION_END_EVENT_NAMES, CLASS_TO_TYPE_MAPPING, KEY_CODES, KEYBOARD_CODES, LOCALES, SPECIAL_REGEX_SEQUENCES, TRANSITION_END_EVENT_NAMES */
|
|
1
22
|
// #!/usr/bin/env babel-node
|
|
2
23
|
// -*- coding: utf-8 -*-
|
|
3
|
-
|
|
24
|
+
/** @module constants *//* !
|
|
25
|
+
region header
|
|
26
|
+
[Project page](https://torben.website/clientnode)
|
|
27
|
+
|
|
28
|
+
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
29
|
+
|
|
30
|
+
License
|
|
31
|
+
-------
|
|
32
|
+
|
|
33
|
+
This library written by Torben Sickert stands under a creative commons
|
|
34
|
+
naming 3.0 unported license.
|
|
35
|
+
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
36
|
+
endregion
|
|
37
|
+
*/var DEFAULT_ENCODING="utf8";var CLOSE_EVENT_NAMES=(/* unused pure expression or super */ null && (["close","exit","SIGINT","SIGTERM","SIGQUIT","uncaughtException"]));var CONSOLE_METHODS=(/* unused pure expression or super */ null && (["debug","error","info","log","warn"]));var VALUE_COPY_SYMBOL=Symbol.for("clientnodeValue");var IGNORE_NULL_AND_UNDEFINED_SYMBOL=Symbol.for("clientnodeIgnoreNullAndUndefined");// Lists all known abbreviation for proper camel case to delimited and back
|
|
38
|
+
// conversion.
|
|
39
|
+
var ABBREVIATIONS=(/* unused pure expression or super */ null && (["html","id","url","us","de","api","href"]));// Saves a string with all css3 browser specific animation end event names.
|
|
40
|
+
var ANIMATION_END_EVENT_NAMES="animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd";// String representation to object type name mapping.
|
|
41
|
+
var CLASS_TO_TYPE_MAPPING=(/* unused pure expression or super */ null && ({"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Error]":"error","[object Function]":"function","[object Map]":"map","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object Set]":"set","[object String]":"string"}));// Saves a mapping from key codes to their corresponding name.
|
|
42
|
+
var KEY_CODES=(/* unused pure expression or super */ null && ({BACKSPACE:8,SPACE:32,TAB:9,DELETE:46,ENTER:13,COMMA:188,PERIOD:190,END:35,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,HOME:36,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,PAGE_UP:33,PAGE_DOWN:34,UP:38,DOWN:40,LEFT:37,RIGHT:39}));var KEYBOARD_CODES=(/* unused pure expression or super */ null && ({BACKSPACE:"Backspace",SPACE:"Space",TAB:"Tab",DELETE:"Delete",ENTER:"Enter",COMMA:"Comma",PERIOD:"Period",END:"End",ESCAPE:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F111",F12:"F12",HOME:"Home",NUMPAD_ADD:"NumpadAdd",NUMPAD_SUBTRACT:"NumpadSubtract",NUMPAD_DECIMAL:"NumpadDecimal",NUMPAD_DIVIDE:"NumpadDivide",NUMPAD_ENTER:"NumpadEnter",NUMPAD_MULTIPLY:"NumpadMultiply",PAGE_UP:"PageUp",PAGE_DOWN:"PageUp",UP:"ArrowUp",DOWN:"ArrowDown",LEFT:"ArrowLeft",RIGHT:"ArrowUp"}));var LOCALES=(/* unused pure expression or super */ null && ([]));var PLAIN_OBJECT_PROTOTYPES=[Object.prototype];// A list of special regular expression symbols.
|
|
43
|
+
var SPECIAL_REGEX_SEQUENCES=(/* unused pure expression or super */ null && (["-","[","]","(",")","^","$","*","+",".","{","}"]));// Saves a string with all css3 browser specific transition end event names.
|
|
44
|
+
var TRANSITION_END_EVENT_NAMES="transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd";
|
|
45
|
+
|
|
46
|
+
/***/ }),
|
|
4
47
|
|
|
48
|
+
/***/ 13:
|
|
49
|
+
/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
50
|
+
|
|
51
|
+
__webpack_require__.a(__webpack_module__, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
|
|
52
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
53
|
+
/* harmony export */ $y: function() { return /* binding */ isSwitchExpression; },
|
|
54
|
+
/* harmony export */ G3: function() { return /* binding */ isCondition; },
|
|
55
|
+
/* harmony export */ Gc: function() { return /* binding */ isAndExpression; },
|
|
56
|
+
/* harmony export */ HK: function() { return /* binding */ isConcatExpression; },
|
|
57
|
+
/* harmony export */ MP: function() { return /* binding */ isIfExpression; },
|
|
58
|
+
/* harmony export */ YG: function() { return /* binding */ isOperation; },
|
|
59
|
+
/* harmony export */ Z9: function() { return /* binding */ isMappingExpression; },
|
|
60
|
+
/* harmony export */ ZI: function() { return /* binding */ isArrayContainsExpression; },
|
|
61
|
+
/* harmony export */ bF: function() { return /* binding */ isUnaryOperation; },
|
|
62
|
+
/* harmony export */ bQ: function() { return /* binding */ isSpecificExpression; },
|
|
63
|
+
/* harmony export */ cB: function() { return /* binding */ isSelector; },
|
|
64
|
+
/* harmony export */ g6: function() { return /* binding */ isOrExpression; },
|
|
65
|
+
/* harmony export */ ml: function() { return /* binding */ isValue; }
|
|
66
|
+
/* harmony export */ });
|
|
67
|
+
/* harmony import */ var _indicators_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
|
|
68
|
+
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_indicators_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
69
|
+
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
70
|
+
_indicators_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
71
|
+
// #!/usr/bin/env babel-node
|
|
72
|
+
// -*- coding: utf-8 -*-
|
|
5
73
|
/* !
|
|
6
74
|
region header
|
|
7
75
|
[Project page](https://torben.website/clientnode)
|
|
@@ -15,23 +83,250 @@
|
|
|
15
83
|
naming 3.0 unported license.
|
|
16
84
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
17
85
|
endregion
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
86
|
+
*/function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}var isSpecificExpression=function isSpecificExpression(expression,indicatorKey,properties){if(properties===void 0){properties=[]}if(!((0,_indicators_js__WEBPACK_IMPORTED_MODULE_0__/* .isPlainObject */ .Qd)(expression)&&Object.prototype.hasOwnProperty.call(expression,indicatorKey)))return false;var _iterator=_createForOfIteratorHelper(properties),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var name=_step.value;if(!Object.prototype.hasOwnProperty.call(expression,name))return false}}catch(err){_iterator.e(err)}finally{_iterator.f()}return true};var isCondition=function isCondition(expression){return isSpecificExpression(expression,"$comparator",["value1","value2"])};var isAndExpression=function isAndExpression(expression){return isSpecificExpression(expression,"$and")};var isOrExpression=function isOrExpression(expression){return isSpecificExpression(expression,"$or")};var isConcatExpression=function isConcatExpression(expression){return isSpecificExpression(expression,"$concat")};var isMappingExpression=function isMappingExpression(expression){return isSpecificExpression(expression,"$mapping",["data"])};var isOperation=function isOperation(expression){return isSpecificExpression(expression,"$operator",["operand1","operand2"])};var isUnaryOperation=function isUnaryOperation(expression){return isSpecificExpression(expression,"$operator",["operand"])};var isIfExpression=function isIfExpression(expression){return isSpecificExpression(expression,"$if")};var isSwitchExpression=function isSwitchExpression(expression){return isSpecificExpression(expression,"$switch")};var isSelector=function isSelector(expression){return isSpecificExpression(expression,"$select")};var isArrayContainsExpression=function isArrayContainsExpression(expression){return isSpecificExpression(expression,"$arrayContains")};var isValue=function isValue(expression){return!(isSelector(expression)||isCondition(expression)||isUnaryOperation(expression)||isOperation(expression)||isAndExpression(expression)||isOrExpression(expression)||isConcatExpression(expression)||isMappingExpression(expression)||isIfExpression(expression)||isSwitchExpression(expression)||isArrayContainsExpression(expression))};
|
|
87
|
+
__webpack_async_result__();
|
|
88
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
89
|
+
|
|
90
|
+
/***/ }),
|
|
91
|
+
|
|
92
|
+
/***/ 3:
|
|
93
|
+
/***/ (function(__webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
94
|
+
|
|
95
|
+
__webpack_require__.a(__webpack_module__, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
|
|
96
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
97
|
+
/* harmony export */ Qd: function() { return /* binding */ isPlainObject; }
|
|
98
|
+
/* harmony export */ });
|
|
99
|
+
/* unused harmony exports isNumeric, isWindow, isArrayLike, isAnyMatching, isObject, isSet, isMap, isProxy, isFunction */
|
|
100
|
+
/* unused harmony import specifier */ var determineType;
|
|
101
|
+
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
102
|
+
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
103
|
+
// #!/usr/bin/env babel-node
|
|
104
|
+
// -*- coding: utf-8 -*-
|
|
105
|
+
/** @module indicators *//* !
|
|
106
|
+
region header
|
|
107
|
+
[Project page](https://torben.website/clientnode)
|
|
108
|
+
|
|
109
|
+
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
110
|
+
|
|
111
|
+
License
|
|
112
|
+
-------
|
|
113
|
+
|
|
114
|
+
This library written by Torben Sickert stands under a creative commons
|
|
115
|
+
naming 3.0 unported license.
|
|
116
|
+
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
117
|
+
endregion
|
|
118
|
+
*/function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}/**
|
|
119
|
+
* Determines whether its argument represents a JavaScript number.
|
|
120
|
+
* @param value - Value to analyze.
|
|
121
|
+
* @returns A boolean value indicating whether given object is numeric
|
|
122
|
+
* like.
|
|
123
|
+
*/var isNumeric=function isNumeric(value){var type=determineType(value);/*
|
|
124
|
+
NOTE: "parseFloat" "NaNs" numeric-cast false positives ("") but
|
|
125
|
+
misinterprets leading-number strings, particularly hex literals
|
|
126
|
+
("0x...") subtraction forces infinities to NaN.
|
|
127
|
+
*/return["number","string"].includes(type)&&!isNaN(value-parseFloat(value))};/**
|
|
128
|
+
* Determine whether the argument is a window.
|
|
129
|
+
* @param value - Value to check for.
|
|
130
|
+
* @returns Boolean value indicating the result.
|
|
131
|
+
*/var isWindow=function isWindow(value){return![null,undefined].includes(value)&&_typeof(value)==="object"&&value===(value===null||value===void 0?void 0:value.window)};/**
|
|
132
|
+
* Checks if given object is similar to an array and can be handled like an
|
|
133
|
+
* array.
|
|
134
|
+
* @param object - Object to check behavior for.
|
|
135
|
+
* @returns A boolean value indicating whether given object is array like.
|
|
136
|
+
*/var isArrayLike=function isArrayLike(object){var length;try{length=Boolean(object)&&object.length}catch(_unused){return false}var type=determineType(object);if(type==="function"||isWindow(object))return false;if(type==="array"||length===0)return true;if(typeof length==="number"&&length>0)try{var _dump=object[length-1];return true}catch(_unused2){// Continue regardless of an error.
|
|
137
|
+
}return false};/**
|
|
138
|
+
* Checks whether one of the given pattern matches given string.
|
|
139
|
+
* @param target - Target to check in pattern for.
|
|
140
|
+
* @param pattern - List of pattern to check for.
|
|
141
|
+
* @returns Value "true" if given object is matches by at leas one of the
|
|
142
|
+
* given pattern and "false" otherwise.
|
|
143
|
+
*/var isAnyMatching=function isAnyMatching(target,pattern){var _iterator=_createForOfIteratorHelper(pattern),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var currentPattern=_step.value;if(typeof currentPattern==="string"){if(currentPattern===target)return true}else if(currentPattern.test(target))return true}}catch(err){_iterator.e(err)}finally{_iterator.f()}return false};/**
|
|
144
|
+
* Checks whether given object is a native object but not null.
|
|
145
|
+
* @param value - Value to check.
|
|
146
|
+
* @returns Value "true" if given object is a plain javaScript object and
|
|
147
|
+
* "false" otherwise.
|
|
148
|
+
*/var isObject=function isObject(value){return value!==null&&_typeof(value)==="object"};/**
|
|
149
|
+
* Checks whether given object is a plain native object.
|
|
150
|
+
* @param value - Value to check.
|
|
151
|
+
* @returns Value "true" if given object is a plain javaScript object and
|
|
152
|
+
* "false" otherwise.
|
|
153
|
+
*/var isPlainObject=function isPlainObject(value){return isObject(value)&&_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .PLAIN_OBJECT_PROTOTYPES */ .jE.includes(Object.getPrototypeOf(value))};/**
|
|
154
|
+
* Checks whether given object is a set.
|
|
155
|
+
* @param value - Value to check.
|
|
156
|
+
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
157
|
+
*/var isSet=function isSet(value){return determineType(value)==="set"};/**
|
|
158
|
+
* Checks whether given object is a map.
|
|
159
|
+
* @param value - Value to check.
|
|
160
|
+
* @returns Value "true" if given object is a map and "false" otherwise.
|
|
161
|
+
*/var isMap=function isMap(value){return determineType(value)==="map"};/**
|
|
162
|
+
* Checks whether given object is a proxy.
|
|
163
|
+
* @param value - Value to check.
|
|
164
|
+
* @returns Value "true" if given object is a proxy and "false" otherwise.
|
|
165
|
+
*/var isProxy=function isProxy(value){return Boolean(value.__target__)};/**
|
|
166
|
+
* Checks whether given object is a function.
|
|
167
|
+
* @param value - Value to check.
|
|
168
|
+
* @returns Value "true" if given object is a function and "false"
|
|
169
|
+
* otherwise.
|
|
170
|
+
*/var isFunction=function isFunction(value){return Boolean(value)&&["[object AsyncFunction]","[object Function]"].includes({}.toString.call(value))};
|
|
171
|
+
__webpack_async_result__();
|
|
172
|
+
} catch(e) { __webpack_async_result__(e); } });
|
|
173
|
+
|
|
174
|
+
/***/ })
|
|
175
|
+
|
|
176
|
+
/******/ });
|
|
177
|
+
/************************************************************************/
|
|
178
|
+
/******/ // The module cache
|
|
179
|
+
/******/ var __webpack_module_cache__ = {};
|
|
180
|
+
/******/
|
|
181
|
+
/******/ // The require function
|
|
182
|
+
/******/ function __webpack_require__(moduleId) {
|
|
183
|
+
/******/ // Check if module is in cache
|
|
184
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
185
|
+
/******/ if (cachedModule !== undefined) {
|
|
186
|
+
/******/ return cachedModule.exports;
|
|
187
|
+
/******/ }
|
|
188
|
+
/******/ // Create a new module (and put it into the cache)
|
|
189
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
190
|
+
/******/ // no module.id needed
|
|
191
|
+
/******/ // no module.loaded needed
|
|
192
|
+
/******/ exports: {}
|
|
193
|
+
/******/ };
|
|
194
|
+
/******/
|
|
195
|
+
/******/ // Execute the module function
|
|
196
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
197
|
+
/******/
|
|
198
|
+
/******/ // Return the exports of the module
|
|
199
|
+
/******/ return module.exports;
|
|
200
|
+
/******/ }
|
|
201
|
+
/******/
|
|
202
|
+
/************************************************************************/
|
|
203
|
+
/******/ /* webpack/runtime/async module */
|
|
204
|
+
/******/ !function() {
|
|
205
|
+
/******/ var hasSymbol = typeof Symbol === "function";
|
|
206
|
+
/******/ var webpackQueues = hasSymbol ? Symbol("webpack queues") : "__webpack_queues__";
|
|
207
|
+
/******/ var webpackExports = hasSymbol ? Symbol("webpack exports") : "__webpack_exports__";
|
|
208
|
+
/******/ var webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
|
209
|
+
/******/
|
|
210
|
+
/******/ var resolveQueue = function(queue) {
|
|
211
|
+
/******/ if(queue && queue.d < 1) {
|
|
212
|
+
/******/ queue.d = 1;
|
|
213
|
+
/******/ queue.forEach(function(fn) { fn.r--; });
|
|
214
|
+
/******/ queue.forEach(function(fn) { fn.r-- ? fn.r++ : fn(); });
|
|
215
|
+
/******/ }
|
|
216
|
+
/******/ }
|
|
217
|
+
/******/ var wrapDeps = function(deps) { return deps.map(function(dep) {
|
|
218
|
+
/******/ if(dep !== null && typeof dep === "object") {
|
|
219
|
+
/******/
|
|
220
|
+
/******/ if(dep[webpackQueues]) return dep;
|
|
221
|
+
/******/ if(dep.then) {
|
|
222
|
+
/******/ var queue = [];
|
|
223
|
+
/******/ queue.d = 0;
|
|
224
|
+
/******/ dep.then(function(r) {
|
|
225
|
+
/******/ obj[webpackExports] = r;
|
|
226
|
+
/******/ resolveQueue(queue);
|
|
227
|
+
/******/ }, function(e) {
|
|
228
|
+
/******/ obj[webpackError] = e;
|
|
229
|
+
/******/ resolveQueue(queue);
|
|
230
|
+
/******/ });
|
|
231
|
+
/******/ var obj = {};
|
|
232
|
+
/******/
|
|
233
|
+
/******/ obj[webpackQueues] = function(fn) { fn(queue); };
|
|
234
|
+
/******/ return obj;
|
|
235
|
+
/******/ }
|
|
236
|
+
/******/ }
|
|
237
|
+
/******/ var ret = {};
|
|
238
|
+
/******/ ret[webpackQueues] = function() {};
|
|
239
|
+
/******/ ret[webpackExports] = dep;
|
|
240
|
+
/******/ return ret;
|
|
241
|
+
/******/ }); };
|
|
242
|
+
/******/ __webpack_require__.a = function(module, body, hasAwait) {
|
|
243
|
+
/******/ var queue;
|
|
244
|
+
/******/ hasAwait && ((queue = []).d = -1);
|
|
245
|
+
/******/ var depQueues = new Set();
|
|
246
|
+
/******/ var exports = module.exports;
|
|
247
|
+
/******/ var currentDeps;
|
|
248
|
+
/******/ var outerResolve;
|
|
249
|
+
/******/ var reject;
|
|
250
|
+
/******/ var promise = new Promise(function(resolve, rej) {
|
|
251
|
+
/******/ reject = rej;
|
|
252
|
+
/******/ outerResolve = resolve;
|
|
253
|
+
/******/ });
|
|
254
|
+
/******/ promise[webpackExports] = exports;
|
|
255
|
+
/******/ promise[webpackQueues] = function(fn) { queue && fn(queue), depQueues.forEach(fn), promise["catch"](function() {}); };
|
|
256
|
+
/******/ module.exports = promise;
|
|
257
|
+
/******/ var handle = function(deps) {
|
|
258
|
+
/******/ currentDeps = wrapDeps(deps);
|
|
259
|
+
/******/ var fn;
|
|
260
|
+
/******/ var getResult = function() { return currentDeps.map(function(d) {
|
|
261
|
+
/******/
|
|
262
|
+
/******/ if(d[webpackError]) throw d[webpackError];
|
|
263
|
+
/******/ return d[webpackExports];
|
|
264
|
+
/******/ }); }
|
|
265
|
+
/******/ var promise = new Promise(function(resolve) {
|
|
266
|
+
/******/ fn = function() { resolve(getResult); };
|
|
267
|
+
/******/ fn.r = 0;
|
|
268
|
+
/******/ var fnQueue = function(q) { q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))); };
|
|
269
|
+
/******/ currentDeps.map(function(dep) { dep[webpackQueues](fnQueue); });
|
|
270
|
+
/******/ });
|
|
271
|
+
/******/ return fn.r ? promise : getResult();
|
|
272
|
+
/******/ }
|
|
273
|
+
/******/ var done = function(err) { (err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue); }
|
|
274
|
+
/******/ body(handle, done);
|
|
275
|
+
/******/ queue && queue.d < 0 && (queue.d = 0);
|
|
276
|
+
/******/ };
|
|
277
|
+
/******/ }();
|
|
278
|
+
/******/
|
|
279
|
+
/******/ /* webpack/runtime/define property getters */
|
|
280
|
+
/******/ !function() {
|
|
281
|
+
/******/ // define getter/value functions for harmony exports
|
|
282
|
+
/******/ __webpack_require__.d = function(exports, definition) {
|
|
283
|
+
/******/ if(Array.isArray(definition)) {
|
|
284
|
+
/******/ var i = 0;
|
|
285
|
+
/******/ while(i < definition.length) {
|
|
286
|
+
/******/ var key = definition[i++];
|
|
287
|
+
/******/ var binding = definition[i++];
|
|
288
|
+
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
289
|
+
/******/ if(binding === 0) {
|
|
290
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
291
|
+
/******/ } else {
|
|
292
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
293
|
+
/******/ }
|
|
294
|
+
/******/ } else if(binding === 0) { i++; }
|
|
295
|
+
/******/ }
|
|
296
|
+
/******/ } else {
|
|
297
|
+
/******/ for(var key in definition) {
|
|
298
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
299
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
300
|
+
/******/ }
|
|
301
|
+
/******/ }
|
|
302
|
+
/******/ }
|
|
303
|
+
/******/ };
|
|
304
|
+
/******/ }();
|
|
305
|
+
/******/
|
|
306
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
307
|
+
/******/ !function() {
|
|
308
|
+
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
309
|
+
/******/ }();
|
|
310
|
+
/******/
|
|
311
|
+
/************************************************************************/
|
|
312
|
+
/******/
|
|
313
|
+
/******/ // startup
|
|
314
|
+
/******/ // Load entry module and return exports
|
|
315
|
+
/******/ // This entry module used 'module' so it can't be inlined
|
|
316
|
+
/******/ var __webpack_exports__ = __webpack_require__(13);
|
|
317
|
+
/******/ __webpack_exports__ = await __webpack_exports__;
|
|
318
|
+
/******/ var __webpack_exports__isAndExpression = __webpack_exports__.Gc;
|
|
319
|
+
/******/ var __webpack_exports__isArrayContainsExpression = __webpack_exports__.ZI;
|
|
320
|
+
/******/ var __webpack_exports__isConcatExpression = __webpack_exports__.HK;
|
|
321
|
+
/******/ var __webpack_exports__isCondition = __webpack_exports__.G3;
|
|
322
|
+
/******/ var __webpack_exports__isIfExpression = __webpack_exports__.MP;
|
|
323
|
+
/******/ var __webpack_exports__isMappingExpression = __webpack_exports__.Z9;
|
|
324
|
+
/******/ var __webpack_exports__isOperation = __webpack_exports__.YG;
|
|
325
|
+
/******/ var __webpack_exports__isOrExpression = __webpack_exports__.g6;
|
|
326
|
+
/******/ var __webpack_exports__isSelector = __webpack_exports__.cB;
|
|
327
|
+
/******/ var __webpack_exports__isSpecificExpression = __webpack_exports__.bQ;
|
|
328
|
+
/******/ var __webpack_exports__isSwitchExpression = __webpack_exports__.$y;
|
|
329
|
+
/******/ var __webpack_exports__isUnaryOperation = __webpack_exports__.bF;
|
|
330
|
+
/******/ var __webpack_exports__isValue = __webpack_exports__.ml;
|
|
331
|
+
/******/ export { __webpack_exports__isAndExpression as isAndExpression, __webpack_exports__isArrayContainsExpression as isArrayContainsExpression, __webpack_exports__isConcatExpression as isConcatExpression, __webpack_exports__isCondition as isCondition, __webpack_exports__isIfExpression as isIfExpression, __webpack_exports__isMappingExpression as isMappingExpression, __webpack_exports__isOperation as isOperation, __webpack_exports__isOrExpression as isOrExpression, __webpack_exports__isSelector as isSelector, __webpack_exports__isSpecificExpression as isSpecificExpression, __webpack_exports__isSwitchExpression as isSwitchExpression, __webpack_exports__isUnaryOperation as isUnaryOperation, __webpack_exports__isValue as isValue };
|
|
332
|
+
/******/
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Mapping } from '../';
|
|
2
|
+
export type BasicScopeType = Array<unknown> | Mapping<unknown> | unknown;
|
|
3
|
+
export type KeyPathOf = string;
|
|
4
|
+
export type SimpleRecursiveKeyOf = number | string;
|
|
5
|
+
export type RecursiveKeyOf = ((scope: unknown) => unknown) | SimpleRecursiveKeyOf;
|
|
6
|
+
export type SelectorItem<Type extends BasicScopeType> = RecursiveKeyOf | Expression<RecursiveKeyOf | number, Type>;
|
|
7
|
+
export type NormalizedSelector<Type extends BasicScopeType> = Array<SelectorItem<Type>>;
|
|
8
|
+
export type Selector<Type extends BasicScopeType> = SelectorItem<Type> | NormalizedSelector<Type>;
|
|
9
|
+
export type ContextReplacements<ScopeType extends BasicScopeType> = Mapping<Selector<ScopeType>>;
|
|
10
|
+
export interface Options<ScopeType extends BasicScopeType> {
|
|
11
|
+
contextReplacements: ContextReplacements<ScopeType>;
|
|
12
|
+
delimiter: string;
|
|
13
|
+
skipMissingLevel: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type Comparator = '==' | '!=' | '<' | '>' | '<=' | '>=';
|
|
16
|
+
export type UnaryOperator = '!' | '!!';
|
|
17
|
+
export type Operator = '+' | '-' | '*' | '**' | '/';
|
|
18
|
+
export type Scope<Type = unknown> = Mapping<Type>;
|
|
19
|
+
export interface Condition {
|
|
20
|
+
value1: Expression;
|
|
21
|
+
$comparator: Comparator;
|
|
22
|
+
value2: Expression;
|
|
23
|
+
}
|
|
24
|
+
export interface IfExpression<Type> {
|
|
25
|
+
$if: Expression<boolean>;
|
|
26
|
+
then?: Expression<Type>;
|
|
27
|
+
else?: Expression<Type>;
|
|
28
|
+
}
|
|
29
|
+
export interface SwitchExpression<Type> {
|
|
30
|
+
$switch: Expression;
|
|
31
|
+
caseExpressions: Array<CaseExpression<Type>>;
|
|
32
|
+
default?: Expression<Type>;
|
|
33
|
+
}
|
|
34
|
+
export interface CaseExpression<Type> {
|
|
35
|
+
$case: Expression;
|
|
36
|
+
then?: Expression<Type>;
|
|
37
|
+
}
|
|
38
|
+
export interface ArrayContainsExpression {
|
|
39
|
+
$arrayContains: {
|
|
40
|
+
target?: Expression;
|
|
41
|
+
key?: Expression<string>;
|
|
42
|
+
value: Expression<string | number | boolean>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface AndExpression {
|
|
46
|
+
$and: Array<Expression<boolean>>;
|
|
47
|
+
}
|
|
48
|
+
export interface OrExpression {
|
|
49
|
+
$or: Array<Expression<boolean>>;
|
|
50
|
+
}
|
|
51
|
+
export interface ConcatExpression {
|
|
52
|
+
$concat: Array<Expression<Array<unknown> | string>>;
|
|
53
|
+
}
|
|
54
|
+
export interface MappingExpression {
|
|
55
|
+
$mapping: Expression<Mapping>;
|
|
56
|
+
data: Expression<Mapping<Mapping<unknown>> | Array<Mapping<unknown>>>;
|
|
57
|
+
}
|
|
58
|
+
export interface UnaryOperation {
|
|
59
|
+
operand: Expression;
|
|
60
|
+
$operator: UnaryOperator;
|
|
61
|
+
}
|
|
62
|
+
export interface Operation {
|
|
63
|
+
operand1: Expression<number>;
|
|
64
|
+
$operator: Operator;
|
|
65
|
+
operand2: Expression<number>;
|
|
66
|
+
}
|
|
67
|
+
export interface SelectorExpression<ScopeType extends BasicScopeType> {
|
|
68
|
+
$select: Selector<ScopeType>;
|
|
69
|
+
}
|
|
70
|
+
export type Expression<Type = unknown, ScopeType extends BasicScopeType = BasicScopeType> = Condition | AndExpression | OrExpression | ConcatExpression | MappingExpression | UnaryOperation | Operation | IfExpression<Type> | SwitchExpression<Type> | ArrayContainsExpression | SelectorExpression<ScopeType> | Type;
|
package/dist/expression/type.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
if(typeof window==='undefined'||window===null)var window=(typeof global==='undefined'||global===null)?{}:global;// #!/usr/bin/env babel-node
|
|
2
2
|
// -*- coding: utf-8 -*-
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
3
|
/* !
|
|
6
4
|
region header
|
|
7
5
|
[Project page](https://torben.website/clientnode)
|
|
@@ -16,5 +14,3 @@
|
|
|
16
14
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
17
15
|
endregion
|
|
18
16
|
*/
|
|
19
|
-
export {};
|
|
20
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vLi4vc3JjL2V4cHJlc3Npb24vdHlwZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAjIS91c3IvYmluL2VudiBiYWJlbC1ub2RlXG4vLyAtKi0gY29kaW5nOiB1dGYtOCAtKi1cbid1c2Ugc3RyaWN0J1xuLyogIVxuICAgIHJlZ2lvbiBoZWFkZXJcbiAgICBbUHJvamVjdCBwYWdlXShodHRwczovL3RvcmJlbi53ZWJzaXRlL2NsaWVudG5vZGUpXG5cbiAgICBDb3B5cmlnaHQgVG9yYmVuIFNpY2tlcnQgKGluZm9bXCJ+YXR+XCJddG9yYmVuLndlYnNpdGUpIDE2LjEyLjIwMTJcblxuICAgIExpY2Vuc2VcbiAgICAtLS0tLS0tXG5cbiAgICBUaGlzIGxpYnJhcnkgd3JpdHRlbiBieSBUb3JiZW4gU2lja2VydCBzdGFuZHMgdW5kZXIgYSBjcmVhdGl2ZSBjb21tb25zXG4gICAgbmFtaW5nIDMuMCB1bnBvcnRlZCBsaWNlbnNlLlxuICAgIFNlZSBodHRwczovL2NyZWF0aXZlY29tbW9ucy5vcmcvbGljZW5zZXMvYnkvMy4wL2RlZWQuZGVcbiAgICBlbmRyZWdpb25cbiovXG5pbXBvcn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R5cGU+IHxcbiAgICBBcnJheUNvbnRhaW5zRXhwcmVzc2lvbiB8XG5cbiAgICBTZWxlY3RvckV4cHJlc3Npb248U2NvcGVUeXBlPiB8XG5cbiAgICBUeXBlXG4iXSwibWFwcGluZ3MiOiJBQUFBO0FBQ0E7QUFDQSxZQUFZOztBQUNaO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFiQSIsImlnbm9yZUxpc3QiOltdfQ==
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { ObjectEncodingOptions } from 'node:fs';
|
|
2
|
+
import type { AnyFunction, Encoding, File, FileTraverseResult } from './type';
|
|
3
|
+
export declare const imports: {
|
|
4
|
+
fs: null | typeof import('fs');
|
|
5
|
+
fsPromises: null | typeof import('fs/promises');
|
|
6
|
+
path: null | typeof import('path');
|
|
7
|
+
};
|
|
8
|
+
export declare const importsPromise: Promise<[typeof import("fs") | null, typeof import("fs/promises") | null, typeof import("node:path") | null]>;
|
|
9
|
+
/**
|
|
10
|
+
* Copies given source directory via path to given target directory location
|
|
11
|
+
* with same target name as source file has or copy to given complete target
|
|
12
|
+
* directory path.
|
|
13
|
+
* @param sourcePath - Path to directory to copy.
|
|
14
|
+
* @param targetPath - Target directory or complete directory location to copy
|
|
15
|
+
* in.
|
|
16
|
+
* @param contents - Indicates whether we only want to copy content of source
|
|
17
|
+
* path without recreating the sourcefile itself on target location.
|
|
18
|
+
* @param callback - Function to invoke for each traversed file.
|
|
19
|
+
* @param readOptions - Options to use for reading source file.
|
|
20
|
+
* @param writeOptions - Options to use for writing to target file.
|
|
21
|
+
* @returns Promise holding the determined target directory path.
|
|
22
|
+
*/
|
|
23
|
+
export declare const copyDirectoryRecursive: (sourcePath: string, targetPath: string, contents?: boolean, callback?: AnyFunction, readOptions?: {
|
|
24
|
+
encoding: null;
|
|
25
|
+
flag: string;
|
|
26
|
+
}, writeOptions?: {
|
|
27
|
+
encoding: Encoding;
|
|
28
|
+
flag: string;
|
|
29
|
+
mode: number;
|
|
30
|
+
}) => Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Copies given source directory via path to given target directory location
|
|
33
|
+
* with same target name as source file has or copy to given complete target
|
|
34
|
+
* directory path.
|
|
35
|
+
* @param sourcePath - Path to directory to copy.
|
|
36
|
+
* @param targetPath - Target directory or complete directory location to copy
|
|
37
|
+
* in.
|
|
38
|
+
* @param contents - Indicates whether we only want to copy content of source
|
|
39
|
+
* path without recreating the sourcefile itself on target location.
|
|
40
|
+
* @param callback - Function to invoke for each traversed file.
|
|
41
|
+
* @param readOptions - Options to use for reading source file.
|
|
42
|
+
* @param writeOptions - Options to use for writing to target file.
|
|
43
|
+
* @returns Determined target directory path.
|
|
44
|
+
*/
|
|
45
|
+
export declare const copyDirectoryRecursiveSync: (sourcePath: string, targetPath: string, contents?: boolean, callback?: AnyFunction, readOptions?: {
|
|
46
|
+
encoding: null;
|
|
47
|
+
flag: string;
|
|
48
|
+
}, writeOptions?: {
|
|
49
|
+
encoding: Encoding;
|
|
50
|
+
flag: string;
|
|
51
|
+
mode: number;
|
|
52
|
+
}) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Copies given source file via path to given target directory location with
|
|
55
|
+
* same target name as source file has or copy to given complete target file
|
|
56
|
+
* path.
|
|
57
|
+
* @param sourcePath - Path to file to copy.
|
|
58
|
+
* @param targetPath - Target directory or complete file location to copy to.
|
|
59
|
+
* @param readOptions - Options to use for reading source file.
|
|
60
|
+
* @param writeOptions - Options to use for writing to target file.
|
|
61
|
+
* @returns Determined target file path.
|
|
62
|
+
*/
|
|
63
|
+
export declare const copyFile: (sourcePath: string, targetPath: string, readOptions?: {
|
|
64
|
+
encoding: null;
|
|
65
|
+
flag: string;
|
|
66
|
+
}, writeOptions?: {
|
|
67
|
+
encoding: Encoding;
|
|
68
|
+
flag: string;
|
|
69
|
+
mode: number;
|
|
70
|
+
}) => Promise<string>;
|
|
71
|
+
/**
|
|
72
|
+
* Copies given source file via path to given target directory location with
|
|
73
|
+
* same target name as source file has or copy to given complete target file
|
|
74
|
+
* path.
|
|
75
|
+
* @param sourcePath - Path to file to copy.
|
|
76
|
+
* @param targetPath - Target directory or complete file location to copy to.
|
|
77
|
+
* @param readOptions - Options to use for reading source file.
|
|
78
|
+
* @param writeOptions - Options to use for writing to target file.
|
|
79
|
+
* @returns Determined target file path.
|
|
80
|
+
*/
|
|
81
|
+
export declare const copyFileSync: (sourcePath: string, targetPath: string, readOptions?: {
|
|
82
|
+
encoding: null;
|
|
83
|
+
flag: string;
|
|
84
|
+
}, writeOptions?: {
|
|
85
|
+
encoding: Encoding;
|
|
86
|
+
flag: string;
|
|
87
|
+
mode: number;
|
|
88
|
+
}) => string;
|
|
89
|
+
/**
|
|
90
|
+
* Checks if given path points to a valid directory.
|
|
91
|
+
* @param filePath - Path to directory.
|
|
92
|
+
* @returns A promise holding a boolean which indicates directory existence.
|
|
93
|
+
*/
|
|
94
|
+
export declare const isDirectory: (filePath: string) => Promise<boolean>;
|
|
95
|
+
/**
|
|
96
|
+
* Checks if given path points to a valid directory.
|
|
97
|
+
* @param filePath - Path to directory.
|
|
98
|
+
* @returns A boolean which indicates directory existence.
|
|
99
|
+
*/
|
|
100
|
+
export declare const isDirectorySync: (filePath: string) => boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Checks if given path points to a valid file.
|
|
103
|
+
* @param filePath - Path to directory.
|
|
104
|
+
* @returns A promise holding a boolean which indicates directory existence.
|
|
105
|
+
*/
|
|
106
|
+
export declare const isFile: (filePath: string) => Promise<boolean>;
|
|
107
|
+
/**
|
|
108
|
+
* Checks if given path points to a valid file.
|
|
109
|
+
* @param filePath - Path to file.
|
|
110
|
+
* @returns A boolean which indicates file existence.
|
|
111
|
+
*/
|
|
112
|
+
export declare const isFileSync: (filePath: string) => boolean;
|
|
113
|
+
/**
|
|
114
|
+
* Iterates through given directory structure recursively and calls given
|
|
115
|
+
* callback for each found file. Callback gets file path and corresponding stat
|
|
116
|
+
* object as argument.
|
|
117
|
+
* @param directoryPath - Path to directory structure to traverse.
|
|
118
|
+
* @param callback - Function to invoke for each traversed file and potentially
|
|
119
|
+
* manipulate further traversing in alphabetical sorted order.
|
|
120
|
+
* If it returns "null" or a promise resolving to "null", no further files
|
|
121
|
+
* will be traversed afterward.
|
|
122
|
+
* If it handles a directory and returns "false" or a promise resolving to
|
|
123
|
+
* "false" no traversing into that directory will occur.
|
|
124
|
+
* @param options - Options to use for nested "readdir" calls.
|
|
125
|
+
* @returns A promise holding the determined files.
|
|
126
|
+
*/
|
|
127
|
+
export declare const walkDirectoryRecursively: (directoryPath: string, callback?: null | ((file: File) => FileTraverseResult), options?: (Encoding | (ObjectEncodingOptions & {
|
|
128
|
+
withFileTypes?: false;
|
|
129
|
+
recursive?: boolean;
|
|
130
|
+
}))) => Promise<Array<File>>;
|
|
131
|
+
/**
|
|
132
|
+
* Iterates through given directory structure recursively and calls given
|
|
133
|
+
* callback for each found file. Callback gets file path and corresponding
|
|
134
|
+
* stats object as argument.
|
|
135
|
+
* @param directoryPath - Path to directory structure to traverse.
|
|
136
|
+
* @param callback - Function to invoke for each traversed file.
|
|
137
|
+
* @param options - Options to use for nested "readdir" calls.
|
|
138
|
+
* @returns Determined list if all files.
|
|
139
|
+
*/
|
|
140
|
+
export declare const walkDirectoryRecursivelySync: (directoryPath: string, callback?: AnyFunction | null, options?: (Encoding | (ObjectEncodingOptions & {
|
|
141
|
+
withFileTypes?: false;
|
|
142
|
+
recursive?: boolean;
|
|
143
|
+
}))) => Array<File>;
|