clientnode 4.0.1458 → 4.0.1460
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Lock.js +83 -69
- package/dist/Logger.js +163 -798
- package/dist/Semaphore.js +46 -56
- package/dist/array.js +337 -668
- package/dist/cli.js +37 -45
- package/dist/constants.js +110 -198
- package/dist/context.js +25 -301
- package/dist/cookie.js +48 -302
- package/dist/data-transfer.js +166 -817
- package/dist/datetime.js +241 -1149
- package/dist/domNode.js +277 -532
- package/dist/expression/evaluators.js +234 -1231
- package/dist/expression/helper.js +82 -102
- package/dist/expression/index.js +10 -1383
- package/dist/expression/indicator-functions.js +21 -316
- package/dist/expression/type.js +5 -1
- package/dist/filesystem.js +324 -385
- package/dist/function.js +51 -93
- package/dist/index.js +26 -3274
- package/dist/indicators.js +68 -519
- package/dist/module.js +99 -233
- package/dist/number.js +25 -498
- package/dist/object.js +791 -958
- package/dist/process.js +38 -298
- package/dist/property-types.js +96 -17
- package/dist/scope.js +56 -2134
- package/dist/string.js +603 -1030
- package/dist/test-helper.js +171 -639
- package/dist/type.js +9 -4
- package/dist/utility.js +91 -408
- package/package.json +2 -2
- package/dist/Lock.d.ts +0 -39
- package/dist/Logger.d.ts +0 -102
- package/dist/Semaphore.d.ts +0 -29
- package/dist/array.d.ts +0 -150
- package/dist/bundle/Lock.js +0 -86
- package/dist/bundle/Logger.js +0 -820
- package/dist/bundle/Semaphore.js +0 -75
- package/dist/bundle/array.js +0 -783
- package/dist/bundle/cli.js +0 -59
- package/dist/bundle/constants.js +0 -214
- package/dist/bundle/context.js +0 -316
- package/dist/bundle/cookie.js +0 -338
- package/dist/bundle/data-transfer.js +0 -867
- package/dist/bundle/datetime.js +0 -1190
- package/dist/bundle/domNode.js +0 -586
- package/dist/bundle/expression/evaluators.js +0 -1270
- package/dist/bundle/expression/helper.js +0 -117
- package/dist/bundle/expression/index.js +0 -1399
- package/dist/bundle/expression/indicator-functions.js +0 -332
- package/dist/bundle/expression/type.js +0 -16
- package/dist/bundle/filesystem.js +0 -472
- package/dist/bundle/function.js +0 -117
- package/dist/bundle/index.js +0 -3291
- package/dist/bundle/indicators.js +0 -572
- package/dist/bundle/module.js +0 -250
- package/dist/bundle/number.js +0 -534
- package/dist/bundle/object.js +0 -1146
- package/dist/bundle/process.js +0 -328
- package/dist/bundle/property-types.js +0 -36
- package/dist/bundle/scope.js +0 -2163
- package/dist/bundle/string.js +0 -1252
- package/dist/bundle/test-helper.js +0 -808
- package/dist/bundle/type.js +0 -16
- package/dist/bundle/utility.js +0 -456
- package/dist/cli.d.ts +0 -31
- package/dist/compatible/Lock.js +0 -86
- package/dist/compatible/Logger.js +0 -820
- package/dist/compatible/Semaphore.js +0 -75
- package/dist/compatible/array.js +0 -783
- package/dist/compatible/cli.js +0 -59
- package/dist/compatible/constants.js +0 -214
- package/dist/compatible/context.js +0 -316
- package/dist/compatible/cookie.js +0 -338
- package/dist/compatible/data-transfer.js +0 -867
- package/dist/compatible/datetime.js +0 -1190
- package/dist/compatible/domNode.js +0 -586
- package/dist/compatible/expression/evaluators.js +0 -1270
- package/dist/compatible/expression/helper.js +0 -117
- package/dist/compatible/expression/index.js +0 -1399
- package/dist/compatible/expression/indicator-functions.js +0 -332
- package/dist/compatible/expression/type.js +0 -16
- package/dist/compatible/filesystem.js +0 -472
- package/dist/compatible/function.js +0 -117
- package/dist/compatible/index.js +0 -3291
- package/dist/compatible/indicators.js +0 -572
- package/dist/compatible/module.js +0 -250
- package/dist/compatible/number.js +0 -534
- package/dist/compatible/object.js +0 -1146
- package/dist/compatible/process.js +0 -328
- package/dist/compatible/property-types.js +0 -36
- package/dist/compatible/scope.js +0 -2163
- package/dist/compatible/string.js +0 -1252
- package/dist/compatible/test-helper.js +0 -808
- package/dist/compatible/type.js +0 -16
- package/dist/compatible/utility.js +0 -456
- package/dist/constants.d.ts +0 -99
- package/dist/context.d.ts +0 -8
- package/dist/cookie.d.ts +0 -31
- package/dist/data-transfer.d.ts +0 -45
- package/dist/datetime.d.ts +0 -37
- package/dist/domNode.d.ts +0 -82
- package/dist/expression/evaluators.d.ts +0 -55
- package/dist/expression/helper.d.ts +0 -4
- package/dist/expression/index.d.ts +0 -7
- package/dist/expression/indicator-functions.d.ts +0 -14
- package/dist/expression/type.d.ts +0 -70
- package/dist/filesystem.d.ts +0 -143
- package/dist/function.d.ts +0 -20
- package/dist/index.d.ts +0 -23
- package/dist/indicators.d.ts +0 -68
- package/dist/module.d.ts +0 -8
- package/dist/number.d.ts +0 -35
- package/dist/object.d.ts +0 -231
- package/dist/process.d.ts +0 -22
- package/dist/property-types.d.ts +0 -460
- package/dist/scope.d.ts +0 -44
- package/dist/string.d.ts +0 -312
- package/dist/test/Lock.d.ts +0 -1
- package/dist/test/Logger.d.ts +0 -1
- package/dist/test/Semaphore.d.ts +0 -1
- package/dist/test/array.d.ts +0 -1
- package/dist/test/cookie.d.ts +0 -1
- package/dist/test/data-transfer.d.ts +0 -1
- package/dist/test/datetime.d.ts +0 -1
- package/dist/test/domNode.d.ts +0 -1
- package/dist/test/expression/evaluators.d.ts +0 -1
- package/dist/test/expression/helper.d.ts +0 -1
- package/dist/test/expression/indicator-functions.d.ts +0 -1
- package/dist/test/filesystem.d.ts +0 -1
- package/dist/test/function.d.ts +0 -1
- package/dist/test/indicators.d.ts +0 -1
- package/dist/test/number.d.ts +0 -1
- package/dist/test/object.d.ts +0 -1
- package/dist/test/process.d.ts +0 -1
- package/dist/test/property-types.d.ts +0 -1
- package/dist/test/scope.d.ts +0 -1
- package/dist/test/string.d.ts +0 -1
- package/dist/test/utility.d.ts +0 -1
- package/dist/test-helper.d.ts +0 -143
- package/dist/type.d.ts +0 -230
- package/dist/utility.d.ts +0 -44
package/dist/utility.js
CHANGED
|
@@ -1,161 +1,9 @@
|
|
|
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
|
-
/* 0 */
|
|
4
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|
5
|
-
|
|
6
|
-
var x = function(y) {
|
|
7
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
|
8
|
-
}
|
|
9
|
-
var y = function(x) { return function() { return x; }; }
|
|
10
|
-
module.exports = x({ });
|
|
11
|
-
|
|
12
|
-
/***/ }),
|
|
13
|
-
/* 1 */,
|
|
14
|
-
/* 2 */
|
|
15
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
16
|
-
|
|
17
|
-
__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
|
|
18
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
19
|
-
/* harmony export */ I5: function() { return /* binding */ optionalRequire; },
|
|
20
|
-
/* harmony export */ Sw: function() { return /* binding */ optionalImport; },
|
|
21
|
-
/* harmony export */ a8: function() { return /* binding */ determineGlobalContext; }
|
|
22
|
-
/* harmony export */ });
|
|
23
|
-
/* unused harmony exports isImportSyntaxSupported, currentRequire, clearRequireCache, isolatedRequire */
|
|
24
|
-
/* module decorator */ module = __webpack_require__.hmd(module);
|
|
25
|
-
// #!/usr/bin/env babel-node
|
|
26
|
-
// -*- coding: utf-8 -*-
|
|
27
|
-
/** @module module *//* !
|
|
28
|
-
region header
|
|
29
|
-
[Project page](https://torben.website/clientnode)
|
|
30
|
-
|
|
31
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
32
|
-
|
|
33
|
-
License
|
|
34
|
-
-------
|
|
35
|
-
|
|
36
|
-
This library written by Torben Sickert stands under a creative commons
|
|
37
|
-
naming 3.0 unported license.
|
|
38
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
39
|
-
endregion
|
|
40
|
-
*/function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}var determineGlobalContext=function determineGlobalContext(){if(typeof globalThis==="undefined"){if(typeof window==="undefined"){if(typeof __webpack_require__.g==="undefined")return false?0:module;if(Object.prototype.hasOwnProperty.call(__webpack_require__.g,"window"))return __webpack_require__.g.window;return __webpack_require__.g}return window}return globalThis};var globalContext=determineGlobalContext();// Make preprocessed import function available at runtime.
|
|
41
|
-
var isImportSyntaxSupported=function isImportSyntaxSupported(){try{// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
42
|
-
new Function("import(\"data:text/javascript,\")");return true}catch(_unused){return false}};// Make preprocessed require function available at runtime.
|
|
43
|
-
var customRequire=typeof globalContext.require==="undefined"?null:globalContext.require;if(!customRequire&&isImportSyntaxSupported())try{var _await$Function=/*
|
|
44
|
-
eslint-disable
|
|
45
|
-
@typescript-eslint/no-implied-eval,
|
|
46
|
-
@typescript-eslint/no-unsafe-call
|
|
47
|
-
*/await new Function("return import(\"node:module\")")(),createRequire=_await$Function.createRequire;/*
|
|
48
|
-
eslint-enable
|
|
49
|
-
@typescript-eslint/no-implied-eval,
|
|
50
|
-
@typescript-eslint/no-unsafe-call
|
|
51
|
-
*/// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
52
|
-
customRequire=createRequire("file:///__w/clientnode/clientnode/src/module.ts")}catch(_unused2){// Ignore error.
|
|
53
|
-
}var currentRequire=customRequire;var optionalRequire=function optionalRequire(id){try{return currentRequire?currentRequire(id):null}catch(_unused3){return null}};var clearRequireCache=function clearRequireCache(cache){if(cache===void 0){cache=(currentRequire===null||currentRequire===void 0?void 0:currentRequire.cache)||__webpack_require__.c}var backup={};for(var _i=0,_Object$entries=Object.entries(cache);_i<_Object$entries.length;_i++){var _Object$entries$_i=_slicedToArray(_Object$entries[_i],2),key=_Object$entries$_i[0],_module=_Object$entries$_i[1];backup[key]=_module;delete cache[key]}return backup};var restoreRequireCache=function restoreRequireCache(cache,backup){if(cache===void 0){cache=(currentRequire===null||currentRequire===void 0?void 0:currentRequire.cache)||__webpack_require__.c}clearRequireCache();for(var _i2=0,_Object$entries2=Object.entries(backup);_i2<_Object$entries2.length;_i2++){var _Object$entries2$_i=_slicedToArray(_Object$entries2[_i2],2),key=_Object$entries2$_i[0],_module2=_Object$entries2$_i[1];cache[key]=_module2}};var isolatedRequire=function isolatedRequire(path,requireFunction){if(requireFunction===void 0){requireFunction=currentRequire||__webpack_require__(6)}var backup=clearRequireCache(requireFunction.cache);try{return requireFunction(path);// eslint-disable-next-line no-useless-catch
|
|
54
|
-
}catch(error){throw error}finally{restoreRequireCache(requireFunction.cache,backup)}};var optionalImport=/*#__PURE__*/function(){var _optionalImport=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(id,options){var _t,_t2;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(options===void 0){options={}}_context.p=1;if(!isImportSyntaxSupported()){_context.n=3;break}_context.n=2;return new Function("options","return import('".concat(id,"', options)"))(options);case 2:_t=_context.v;_context.n=5;break;case 3:_context.n=4;return Promise.resolve(null);case 4:_t=_context.v;case 5:return _context.a(2,_t);case 6:_context.p=6;_t2=_context.v;console.error("OptionalImport failed for",id,_t2);_context.n=7;return Promise.resolve(null);case 7:return _context.a(2,_context.v)}},_callee,null,[[1,6]])}));function optionalImport(_x,_x2){return _optionalImport.apply(this,arguments)}return optionalImport}();
|
|
55
|
-
__webpack_async_result__();
|
|
56
|
-
} catch(e) { __webpack_async_result__(e); } }, 1);
|
|
57
|
-
|
|
58
|
-
/***/ }),
|
|
59
|
-
/* 3 */,
|
|
60
|
-
/* 4 */
|
|
61
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
62
|
-
|
|
63
|
-
__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
|
|
64
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
65
|
-
/* harmony export */ Tn: function() { return /* binding */ isFunction; }
|
|
66
|
-
/* harmony export */ });
|
|
67
|
-
/* unused harmony exports isNumeric, isWindow, isArrayLike, isAnyMatching, isObject, isPlainObject, isSet, isMap, isProxy */
|
|
68
|
-
/* unused harmony import specifier */ var PLAIN_OBJECT_PROTOTYPES;
|
|
69
|
-
/* unused harmony import specifier */ var determineType;
|
|
70
|
-
/* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
71
1
|
// #!/usr/bin/env babel-node
|
|
72
2
|
// -*- coding: utf-8 -*-
|
|
73
|
-
/** @module
|
|
74
|
-
|
|
75
|
-
[Project page](https://torben.website/clientnode)
|
|
76
|
-
|
|
77
|
-
Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
|
|
78
|
-
|
|
79
|
-
License
|
|
80
|
-
-------
|
|
3
|
+
/** @module utility */
|
|
4
|
+
'use strict';
|
|
81
5
|
|
|
82
|
-
|
|
83
|
-
naming 3.0 unported license.
|
|
84
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
85
|
-
endregion
|
|
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}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)}/**
|
|
87
|
-
* Determines whether its argument represents a JavaScript number.
|
|
88
|
-
* @param value - Value to analyze.
|
|
89
|
-
* @returns A boolean value indicating whether given object is numeric
|
|
90
|
-
* like.
|
|
91
|
-
*/var isNumeric=function isNumeric(value){var type=determineType(value);/*
|
|
92
|
-
NOTE: "parseFloat" "NaNs" numeric-cast false positives ("") but
|
|
93
|
-
misinterprets leading-number strings, particularly hex literals
|
|
94
|
-
("0x...") subtraction forces infinities to NaN.
|
|
95
|
-
*/return["number","string"].includes(type)&&!isNaN(value-parseFloat(value))};/**
|
|
96
|
-
* Determine whether the argument is a window.
|
|
97
|
-
* @param value - Value to check for.
|
|
98
|
-
* @returns Boolean value indicating the result.
|
|
99
|
-
*/var isWindow=function isWindow(value){return![null,undefined].includes(value)&&_typeof(value)==="object"&&value===(value===null||value===void 0?void 0:value.window)};/**
|
|
100
|
-
* Checks if given object is similar to an array and can be handled like an
|
|
101
|
-
* array.
|
|
102
|
-
* @param object - Object to check behavior for.
|
|
103
|
-
* @returns A boolean value indicating whether given object is array like.
|
|
104
|
-
*/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.
|
|
105
|
-
}return false};/**
|
|
106
|
-
* Checks whether one of the given pattern matches given string.
|
|
107
|
-
* @param target - Target to check in pattern for.
|
|
108
|
-
* @param pattern - List of pattern to check for.
|
|
109
|
-
* @returns Value "true" if given object is matches by at leas one of the
|
|
110
|
-
* given pattern and "false" otherwise.
|
|
111
|
-
*/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};/**
|
|
112
|
-
* Checks whether given object is a native object but not null.
|
|
113
|
-
* @param value - Value to check.
|
|
114
|
-
* @returns Value "true" if given object is a plain javaScript object and
|
|
115
|
-
* "false" otherwise.
|
|
116
|
-
*/var isObject=function isObject(value){return value!==null&&_typeof(value)==="object"};/**
|
|
117
|
-
* Checks whether given object is a plain native object.
|
|
118
|
-
* @param value - Value to check.
|
|
119
|
-
* @returns Value "true" if given object is a plain javaScript object and
|
|
120
|
-
* "false" otherwise.
|
|
121
|
-
*/var isPlainObject=function isPlainObject(value){return isObject(value)&&PLAIN_OBJECT_PROTOTYPES.includes(Object.getPrototypeOf(value))};/**
|
|
122
|
-
* Checks whether given object is a set.
|
|
123
|
-
* @param value - Value to check.
|
|
124
|
-
* @returns Value "true" if given object is a set and "false" otherwise.
|
|
125
|
-
*/var isSet=function isSet(value){return determineType(value)==="set"};/**
|
|
126
|
-
* Checks whether given object is a map.
|
|
127
|
-
* @param value - Value to check.
|
|
128
|
-
* @returns Value "true" if given object is a map and "false" otherwise.
|
|
129
|
-
*/var isMap=function isMap(value){return determineType(value)==="map"};/**
|
|
130
|
-
* Checks whether given object is a proxy.
|
|
131
|
-
* @param value - Value to check.
|
|
132
|
-
* @returns Value "true" if given object is a proxy and "false" otherwise.
|
|
133
|
-
*/var isProxy=function isProxy(value){return Boolean(value.__target__)};/**
|
|
134
|
-
* Checks whether given object is a function.
|
|
135
|
-
* @param value - Value to check.
|
|
136
|
-
* @returns Value "true" if given object is a function and "false"
|
|
137
|
-
* otherwise.
|
|
138
|
-
*/var isFunction=function isFunction(value){return Boolean(value)&&["[object AsyncFunction]","[object Function]"].includes({}.toString.call(value))};
|
|
139
|
-
__webpack_async_result__();
|
|
140
|
-
} catch(e) { __webpack_async_result__(e); } });
|
|
141
|
-
|
|
142
|
-
/***/ }),
|
|
143
|
-
/* 5 */
|
|
144
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
145
|
-
|
|
146
|
-
__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
|
|
147
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
148
|
-
/* harmony export */ tE: function() { return /* binding */ NOOP; }
|
|
149
|
-
/* harmony export */ });
|
|
150
|
-
/* unused harmony exports globalContext, setGlobalContext, MAXIMAL_NUMBER_OF_ITERATIONS, mockConsole */
|
|
151
|
-
/* unused harmony import specifier */ var CONSOLE_METHODS;
|
|
152
|
-
/* harmony import */ var _module_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
153
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_module_js__WEBPACK_IMPORTED_MODULE_0__]);
|
|
154
|
-
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
155
|
-
_module_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
156
|
-
// #!/usr/bin/env babel-node
|
|
157
|
-
// -*- coding: utf-8 -*-
|
|
158
|
-
/** @module context *//* !
|
|
6
|
+
/* !
|
|
159
7
|
region header
|
|
160
8
|
[Project page](https://torben.website/clientnode)
|
|
161
9
|
|
|
@@ -168,67 +16,11 @@ _module_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[
|
|
|
168
16
|
naming 3.0 unported license.
|
|
169
17
|
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
170
18
|
endregion
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
if(!Object.prototype.hasOwnProperty.call(globalContext,"console"))globalContext.console={};if(!globalContext.console)globalContext.console={};var _iterator=_createForOfIteratorHelper(CONSOLE_METHODS),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var methodName=_step.value;if(!(methodName in globalContext.console))globalContext.console[methodName]=NOOP}}catch(err){_iterator.e(err)}finally{_iterator.f()}};
|
|
175
|
-
__webpack_async_result__();
|
|
176
|
-
} catch(e) { __webpack_async_result__(e); } });
|
|
177
|
-
|
|
178
|
-
/***/ }),
|
|
179
|
-
/* 6 */
|
|
180
|
-
/***/ (function(module) {
|
|
181
|
-
|
|
182
|
-
function webpackEmptyContext(req) {
|
|
183
|
-
var e = new Error("Cannot find module '" + req + "'");
|
|
184
|
-
e.code = 'MODULE_NOT_FOUND';
|
|
185
|
-
throw e;
|
|
186
|
-
}
|
|
187
|
-
webpackEmptyContext.keys = function() { return []; };
|
|
188
|
-
webpackEmptyContext.resolve = webpackEmptyContext;
|
|
189
|
-
webpackEmptyContext.id = 6;
|
|
190
|
-
module.exports = webpackEmptyContext;
|
|
191
|
-
|
|
192
|
-
/***/ }),
|
|
193
|
-
/* 7 */,
|
|
194
|
-
/* 8 */,
|
|
195
|
-
/* 9 */,
|
|
196
|
-
/* 10 */,
|
|
197
|
-
/* 11 */,
|
|
198
|
-
/* 12 */,
|
|
199
|
-
/* 13 */
|
|
200
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
201
|
-
|
|
202
|
-
__webpack_require__.a(module, async function (__webpack_handle_async_dependencies__, __webpack_async_result__) { try {
|
|
203
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
204
|
-
/* harmony export */ dG: function() { return /* binding */ stopPropagation; },
|
|
205
|
-
/* harmony export */ p0: function() { return /* binding */ trailingThrottle; },
|
|
206
|
-
/* harmony export */ sg: function() { return /* binding */ debounce; },
|
|
207
|
-
/* harmony export */ wR: function() { return /* binding */ timeout; },
|
|
208
|
-
/* harmony export */ wo: function() { return /* binding */ preventDefault; }
|
|
209
|
-
/* harmony export */ });
|
|
210
|
-
/* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
|
|
211
|
-
/* harmony import */ var _indicators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
212
|
-
var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_context_js__WEBPACK_IMPORTED_MODULE_0__, _indicators_js__WEBPACK_IMPORTED_MODULE_1__]);
|
|
213
|
-
var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
|
214
|
-
_context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
|
|
215
|
-
_indicators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_async_dependencies_result__[1];
|
|
216
|
-
// #!/usr/bin/env babel-node
|
|
217
|
-
// -*- coding: utf-8 -*-
|
|
218
|
-
/** @module utility *//* !
|
|
219
|
-
region header
|
|
220
|
-
[Project page](https://torben.website/clientnode)
|
|
19
|
+
*/
|
|
20
|
+
import { NOOP } from "./context.js";
|
|
21
|
+
import { isFunction } from "./indicators.js";
|
|
221
22
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
License
|
|
225
|
-
-------
|
|
226
|
-
|
|
227
|
-
This library written by Torben Sickert stands under a creative commons
|
|
228
|
-
naming 3.0 unported license.
|
|
229
|
-
See https://creativecommons.org/licenses/by/3.0/deed.de
|
|
230
|
-
endregion
|
|
231
|
-
*/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 _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 _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 _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}/**
|
|
23
|
+
/**
|
|
232
24
|
* Prevents event functions from triggering too often by defining a minimal
|
|
233
25
|
* span between each function call. Additional arguments given to this function
|
|
234
26
|
* will be forwarded to the given event function call.
|
|
@@ -238,8 +30,23 @@ _indicators_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_async_dependencies_resul
|
|
|
238
30
|
* @param additionalArguments - Additional arguments to forward to given
|
|
239
31
|
* function.
|
|
240
32
|
* @returns Returns the wrapped method.
|
|
241
|
-
*/
|
|
242
|
-
|
|
33
|
+
*/
|
|
34
|
+
export const trailingThrottle = (callback, thresholdInMilliseconds = 600, ...additionalArguments) => {
|
|
35
|
+
let timeoutID = null;
|
|
36
|
+
let recentParameters = [];
|
|
37
|
+
return (...parameters) => {
|
|
38
|
+
recentParameters = parameters;
|
|
39
|
+
if (timeoutID) return;
|
|
40
|
+
timeoutID = setTimeout(() => {
|
|
41
|
+
callback(...recentParameters, ...additionalArguments);
|
|
42
|
+
|
|
43
|
+
// Reset for next cycle.
|
|
44
|
+
timeoutID = null;
|
|
45
|
+
recentParameters = [];
|
|
46
|
+
}, thresholdInMilliseconds);
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
243
50
|
* Prevents event functions from triggering too close after each trigger by
|
|
244
51
|
* defining a minimal span between each function call. Additional arguments
|
|
245
52
|
* given to this function will be forwarded to the given event function call.
|
|
@@ -249,7 +56,26 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
249
56
|
* @param additionalArguments - Additional arguments to forward to given
|
|
250
57
|
* function.
|
|
251
58
|
* @returns Returns the wrapped method.
|
|
252
|
-
*/
|
|
59
|
+
*/
|
|
60
|
+
export const debounce = (callback, thresholdInMilliseconds = 600, ...additionalArguments) => {
|
|
61
|
+
let timeoutPromise;
|
|
62
|
+
let nextResultPromiseResolver;
|
|
63
|
+
let nextResultPromise = new Promise(resolve => {
|
|
64
|
+
nextResultPromiseResolver = resolve;
|
|
65
|
+
});
|
|
66
|
+
return (...parameters) => {
|
|
67
|
+
parameters = parameters.concat(additionalArguments);
|
|
68
|
+
timeoutPromise?.clear();
|
|
69
|
+
timeoutPromise = timeout(() => {
|
|
70
|
+
nextResultPromiseResolver(callback(...parameters));
|
|
71
|
+
nextResultPromise = new Promise(resolve => {
|
|
72
|
+
nextResultPromiseResolver = resolve;
|
|
73
|
+
});
|
|
74
|
+
}, thresholdInMilliseconds);
|
|
75
|
+
return nextResultPromise;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
253
79
|
* Triggers given callback after given duration. Supports unlimited
|
|
254
80
|
* duration length and returns a promise which will be resolved after given
|
|
255
81
|
* duration has been passed.
|
|
@@ -264,193 +90,50 @@ timeoutID=null;recentParameters=[]},thresholdInMilliseconds)}};/**
|
|
|
264
90
|
* value "true" is within one of the first three parameters. The promise
|
|
265
91
|
* holds a boolean indicating whether timeout has been canceled or
|
|
266
92
|
* resolved.
|
|
267
|
-
*/
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
/******/ var webpackError = hasSymbol ? Symbol("webpack error") : "__webpack_error__";
|
|
314
|
-
/******/
|
|
315
|
-
/******/ var resolveQueue = function(queue) {
|
|
316
|
-
/******/ if(queue && queue.d < 1) {
|
|
317
|
-
/******/ queue.d = 1;
|
|
318
|
-
/******/ queue.forEach(function(fn) { fn.r--; });
|
|
319
|
-
/******/ queue.forEach(function(fn) { fn.r-- ? fn.r++ : fn(); });
|
|
320
|
-
/******/ }
|
|
321
|
-
/******/ }
|
|
322
|
-
/******/ var wrapDeps = function(deps) { return deps.map(function(dep) {
|
|
323
|
-
/******/ if(dep !== null && typeof dep === "object") {
|
|
324
|
-
/******/
|
|
325
|
-
/******/ if(dep[webpackQueues]) return dep;
|
|
326
|
-
/******/ if(dep.then) {
|
|
327
|
-
/******/ var queue = [];
|
|
328
|
-
/******/ queue.d = 0;
|
|
329
|
-
/******/ dep.then(function(r) {
|
|
330
|
-
/******/ obj[webpackExports] = r;
|
|
331
|
-
/******/ resolveQueue(queue);
|
|
332
|
-
/******/ }, function(e) {
|
|
333
|
-
/******/ obj[webpackError] = e;
|
|
334
|
-
/******/ resolveQueue(queue);
|
|
335
|
-
/******/ });
|
|
336
|
-
/******/ var obj = {};
|
|
337
|
-
/******/
|
|
338
|
-
/******/ obj[webpackQueues] = function(fn) { fn(queue); };
|
|
339
|
-
/******/ return obj;
|
|
340
|
-
/******/ }
|
|
341
|
-
/******/ }
|
|
342
|
-
/******/ var ret = {};
|
|
343
|
-
/******/ ret[webpackQueues] = function() {};
|
|
344
|
-
/******/ ret[webpackExports] = dep;
|
|
345
|
-
/******/ return ret;
|
|
346
|
-
/******/ }); };
|
|
347
|
-
/******/ __webpack_require__.a = function(module, body, hasAwait) {
|
|
348
|
-
/******/ var queue;
|
|
349
|
-
/******/ hasAwait && ((queue = []).d = -1);
|
|
350
|
-
/******/ var depQueues = new Set();
|
|
351
|
-
/******/ var exports = module.exports;
|
|
352
|
-
/******/ var currentDeps;
|
|
353
|
-
/******/ var outerResolve;
|
|
354
|
-
/******/ var reject;
|
|
355
|
-
/******/ var promise = new Promise(function(resolve, rej) {
|
|
356
|
-
/******/ reject = rej;
|
|
357
|
-
/******/ outerResolve = resolve;
|
|
358
|
-
/******/ });
|
|
359
|
-
/******/ promise[webpackExports] = exports;
|
|
360
|
-
/******/ promise[webpackQueues] = function(fn) { queue && fn(queue), depQueues.forEach(fn), promise["catch"](function() {}); };
|
|
361
|
-
/******/ module.exports = promise;
|
|
362
|
-
/******/ var handle = function(deps) {
|
|
363
|
-
/******/ currentDeps = wrapDeps(deps);
|
|
364
|
-
/******/ var fn;
|
|
365
|
-
/******/ var getResult = function() { return currentDeps.map(function(d) {
|
|
366
|
-
/******/
|
|
367
|
-
/******/ if(d[webpackError]) throw d[webpackError];
|
|
368
|
-
/******/ return d[webpackExports];
|
|
369
|
-
/******/ }); }
|
|
370
|
-
/******/ var promise = new Promise(function(resolve) {
|
|
371
|
-
/******/ fn = function() { resolve(getResult); };
|
|
372
|
-
/******/ fn.r = 0;
|
|
373
|
-
/******/ var fnQueue = function(q) { q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))); };
|
|
374
|
-
/******/ currentDeps.map(function(dep) { dep[webpackQueues](fnQueue); });
|
|
375
|
-
/******/ });
|
|
376
|
-
/******/ return fn.r ? promise : getResult();
|
|
377
|
-
/******/ }
|
|
378
|
-
/******/ var done = function(err) { (err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue); }
|
|
379
|
-
/******/ body(handle, done);
|
|
380
|
-
/******/ queue && queue.d < 0 && (queue.d = 0);
|
|
381
|
-
/******/ };
|
|
382
|
-
/******/ }();
|
|
383
|
-
/******/
|
|
384
|
-
/******/ /* webpack/runtime/define property getters */
|
|
385
|
-
/******/ !function() {
|
|
386
|
-
/******/ // define getter/value functions for harmony exports
|
|
387
|
-
/******/ __webpack_require__.d = function(exports, definition) {
|
|
388
|
-
/******/ if(Array.isArray(definition)) {
|
|
389
|
-
/******/ var i = 0;
|
|
390
|
-
/******/ while(i < definition.length) {
|
|
391
|
-
/******/ var key = definition[i++];
|
|
392
|
-
/******/ var binding = definition[i++];
|
|
393
|
-
/******/ if(!__webpack_require__.o(exports, key)) {
|
|
394
|
-
/******/ if(binding === 0) {
|
|
395
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
|
|
396
|
-
/******/ } else {
|
|
397
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
|
|
398
|
-
/******/ }
|
|
399
|
-
/******/ } else if(binding === 0) { i++; }
|
|
400
|
-
/******/ }
|
|
401
|
-
/******/ } else {
|
|
402
|
-
/******/ for(var key in definition) {
|
|
403
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
404
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
405
|
-
/******/ }
|
|
406
|
-
/******/ }
|
|
407
|
-
/******/ }
|
|
408
|
-
/******/ };
|
|
409
|
-
/******/ }();
|
|
410
|
-
/******/
|
|
411
|
-
/******/ /* webpack/runtime/global */
|
|
412
|
-
/******/ !function() {
|
|
413
|
-
/******/ __webpack_require__.g = (function() {
|
|
414
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
415
|
-
/******/ try {
|
|
416
|
-
/******/ return this || new Function('return this')();
|
|
417
|
-
/******/ } catch (e) {
|
|
418
|
-
/******/ if (typeof window === 'object') return window;
|
|
419
|
-
/******/ }
|
|
420
|
-
/******/ })();
|
|
421
|
-
/******/ }();
|
|
422
|
-
/******/
|
|
423
|
-
/******/ /* webpack/runtime/harmony module decorator */
|
|
424
|
-
/******/ !function() {
|
|
425
|
-
/******/ __webpack_require__.hmd = function(module) {
|
|
426
|
-
/******/ module = Object.create(module);
|
|
427
|
-
/******/ if (!module.children) module.children = [];
|
|
428
|
-
/******/ Object.defineProperty(module, 'exports', {
|
|
429
|
-
/******/ enumerable: true,
|
|
430
|
-
/******/ set: function() {
|
|
431
|
-
/******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
|
|
432
|
-
/******/ }
|
|
433
|
-
/******/ });
|
|
434
|
-
/******/ return module;
|
|
435
|
-
/******/ };
|
|
436
|
-
/******/ }();
|
|
437
|
-
/******/
|
|
438
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
439
|
-
/******/ !function() {
|
|
440
|
-
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
441
|
-
/******/ }();
|
|
442
|
-
/******/
|
|
443
|
-
/************************************************************************/
|
|
444
|
-
/******/
|
|
445
|
-
/******/ // module cache are used so entry inlining is disabled
|
|
446
|
-
/******/ // startup
|
|
447
|
-
/******/ // Load entry module and return exports
|
|
448
|
-
/******/ var __webpack_exports__ = __webpack_require__(13);
|
|
449
|
-
/******/ __webpack_exports__ = await __webpack_exports__;
|
|
450
|
-
/******/ var __webpack_exports__debounce = __webpack_exports__.sg;
|
|
451
|
-
/******/ var __webpack_exports__preventDefault = __webpack_exports__.wo;
|
|
452
|
-
/******/ var __webpack_exports__stopPropagation = __webpack_exports__.dG;
|
|
453
|
-
/******/ var __webpack_exports__timeout = __webpack_exports__.wR;
|
|
454
|
-
/******/ var __webpack_exports__trailingThrottle = __webpack_exports__.p0;
|
|
455
|
-
/******/ export { __webpack_exports__debounce as debounce, __webpack_exports__preventDefault as preventDefault, __webpack_exports__stopPropagation as stopPropagation, __webpack_exports__timeout as timeout, __webpack_exports__trailingThrottle as trailingThrottle };
|
|
456
|
-
/******/
|
|
93
|
+
*/
|
|
94
|
+
export const timeout = (...parameters) => {
|
|
95
|
+
let callback = NOOP;
|
|
96
|
+
let delayInMilliseconds = 0;
|
|
97
|
+
let throwOnTimeoutClear = false;
|
|
98
|
+
for (const value of parameters) if (typeof value === 'number' && !isNaN(value)) delayInMilliseconds = value;else if (typeof value === 'boolean') throwOnTimeoutClear = value;else if (isFunction(value)) callback = value;
|
|
99
|
+
let rejectCallback;
|
|
100
|
+
let resolveCallback;
|
|
101
|
+
const result = new Promise((resolve, reject) => {
|
|
102
|
+
rejectCallback = reject;
|
|
103
|
+
resolveCallback = resolve;
|
|
104
|
+
});
|
|
105
|
+
const wrappedCallback = () => {
|
|
106
|
+
callback.call(result, ...parameters);
|
|
107
|
+
resolveCallback(false);
|
|
108
|
+
};
|
|
109
|
+
const maximumTimeoutDelayInMilliseconds = 2147483647;
|
|
110
|
+
if (delayInMilliseconds <= maximumTimeoutDelayInMilliseconds) result.timeoutID = setTimeout(wrappedCallback, delayInMilliseconds);else {
|
|
111
|
+
/*
|
|
112
|
+
Determine the number of times we need to delay by maximum
|
|
113
|
+
possible timeout duration.
|
|
114
|
+
*/
|
|
115
|
+
let numberOfRemainingTimeouts = Math.floor(delayInMilliseconds / maximumTimeoutDelayInMilliseconds);
|
|
116
|
+
const finalTimeoutDuration = delayInMilliseconds % maximumTimeoutDelayInMilliseconds;
|
|
117
|
+
const delay = () => {
|
|
118
|
+
if (numberOfRemainingTimeouts > 0) {
|
|
119
|
+
numberOfRemainingTimeouts -= 1;
|
|
120
|
+
result.timeoutID = setTimeout(delay, maximumTimeoutDelayInMilliseconds);
|
|
121
|
+
} else result.timeoutID = setTimeout(wrappedCallback, finalTimeoutDuration);
|
|
122
|
+
};
|
|
123
|
+
delay();
|
|
124
|
+
}
|
|
125
|
+
result.clear = () => {
|
|
126
|
+
if (Object.prototype.hasOwnProperty.call(result, 'timeoutID')) {
|
|
127
|
+
clearTimeout(result.timeoutID);
|
|
128
|
+
(throwOnTimeoutClear ? rejectCallback : resolveCallback)(true);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
return result;
|
|
132
|
+
};
|
|
133
|
+
export const preventDefault = event => {
|
|
134
|
+
event.preventDefault();
|
|
135
|
+
};
|
|
136
|
+
export const stopPropagation = event => {
|
|
137
|
+
event.stopPropagation();
|
|
138
|
+
};
|
|
139
|
+
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL3V0aWxpdHkudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gIyEvdXNyL2Jpbi9lbnYgYmFiZWwtbm9kZVxuLy8gLSotIGNvZGluZzogdXRmLTggLSotXG4vKiogQG1vZHVsZSB1dGlsaXR5ICovXG4ndXNlIHN0cmljdCdcbi8qICFcbiAgICByZWdpb24gaGVhZGVyXG4gICAgW1Byb2plY3QgcGFnZV0oaHR0cHM6Ly90b3JiZW4ud2Vic2l0ZS9jbGllbnRub2RlKVxuXG4gICAgQ29weXJpZ2h0IFRvcmJlbiBTaWNrZXJ0IChpbmZvW1wifmF0flwiXXRvcmJlbi53ZWJzaXRlKSAxN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ksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDO01BQzdCLENBQUMsbUJBQW1CLEdBQUcsY0FBYyxHQUFHLGVBQWUsRUFBRSxJQUFJLENBQUM7SUFDbkU7RUFDSixDQUFDO0VBRUQsT0FBTyxNQUFNO0FBQ2pCLENBQUM7QUFDRCxPQUFPLE1BQU0sY0FBYyxHQUFJLEtBQVksSUFBSztFQUM1QyxLQUFLLENBQUMsY0FBYyxDQUFDLENBQUM7QUFDMUIsQ0FBQztBQUNELE9BQU8sTUFBTSxlQUFlLEdBQUksS0FBWSxJQUFLO0VBQzdDLEtBQUssQ0FBQyxlQUFlLENBQUMsQ0FBQztBQUMzQixDQUFDIiwiaWdub3JlTGlzdCI6W119
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clientnode",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1460",
|
|
4
4
|
"description": "Handy utilities for any JavaScript environments.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"client",
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
"yarn": ">=4"
|
|
128
128
|
},
|
|
129
129
|
"resolutions": {
|
|
130
|
-
"weboptimizer/clientnode": "4.0.
|
|
130
|
+
"weboptimizer/clientnode": "4.0.1458",
|
|
131
131
|
"colors": "1.4.0",
|
|
132
132
|
"globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
133
133
|
"globals@npm:^11.1.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
package/dist/Lock.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { LockCallbackFunction, Mapping } from './type';
|
|
2
|
-
/**
|
|
3
|
-
* Represents the lock state.
|
|
4
|
-
* @property locks - Mapping of lock descriptions to their corresponding
|
|
5
|
-
* callbacks.
|
|
6
|
-
*/
|
|
7
|
-
export declare class Lock<Type = string | undefined> {
|
|
8
|
-
lock?: Array<LockCallbackFunction<Type>>;
|
|
9
|
-
locks: Mapping<Array<LockCallbackFunction<Type>>>;
|
|
10
|
-
/**
|
|
11
|
-
* Initializes locks.
|
|
12
|
-
* @param locks - Mapping of a lock description to callbacks for calling
|
|
13
|
-
* when given lock should be released.
|
|
14
|
-
*/
|
|
15
|
-
constructor(locks?: Mapping<Array<LockCallbackFunction<Type>>>);
|
|
16
|
-
/**
|
|
17
|
-
* Calling this method introduces a starting point for a critical area with
|
|
18
|
-
* potential race conditions. The area will be bind to given description
|
|
19
|
-
* string. So don't use same names for different areas.
|
|
20
|
-
* @param description - A short string describing the critical areas
|
|
21
|
-
* properties.
|
|
22
|
-
* @param callback - A procedure which should only be executed if the
|
|
23
|
-
* interpreter isn't in the given critical area. The lock description
|
|
24
|
-
* string will be given to the callback function.
|
|
25
|
-
* @param autoRelease - Release the lock after execution of given callback.
|
|
26
|
-
* @returns Returns a promise which will be resolved after releasing lock.
|
|
27
|
-
*/
|
|
28
|
-
acquire(description?: string, callback?: LockCallbackFunction<Type>, autoRelease?: boolean): Promise<Type>;
|
|
29
|
-
/**
|
|
30
|
-
* Calling this method causes the given critical area to be finished and
|
|
31
|
-
* all functions given to "acquire()" will be executed in right order.
|
|
32
|
-
* @param description - A short string describing the critical areas
|
|
33
|
-
* properties.
|
|
34
|
-
* @returns Returns the return (maybe promise resolved) value of the
|
|
35
|
-
* callback given to the "acquire" method.
|
|
36
|
-
*/
|
|
37
|
-
release(description?: string): Promise<Type | undefined>;
|
|
38
|
-
}
|
|
39
|
-
export default Lock;
|