clientnode 4.0.1428 → 4.0.1430

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.
Files changed (143) hide show
  1. package/dist/Lock.js +100 -1
  2. package/dist/Logger.js +185 -1
  3. package/dist/Semaphore.js +65 -1
  4. package/dist/array.js +452 -1
  5. package/dist/cli.js +51 -1
  6. package/dist/constants.js +126 -1
  7. package/dist/context.js +40 -1
  8. package/dist/cookie.js +84 -1
  9. package/dist/data-transfer.js +216 -1
  10. package/dist/datetime.js +282 -1
  11. package/dist/domNode.js +331 -1
  12. package/dist/expression/evaluators.js +273 -1
  13. package/dist/expression/helper.js +97 -1
  14. package/dist/expression/index.js +26 -1
  15. package/dist/expression/indicator-functions.js +37 -1
  16. package/dist/expression/type.js +20 -0
  17. package/dist/filesystem.js +410 -1
  18. package/dist/function.js +75 -1
  19. package/dist/index.js +43 -1
  20. package/dist/indicators.js +121 -1
  21. package/dist/number.js +61 -1
  22. package/dist/object.js +934 -1
  23. package/dist/process.js +69 -1
  24. package/dist/property-types.js +115 -1
  25. package/dist/require.js +82 -1
  26. package/dist/scope.js +85 -1
  27. package/dist/string.js +806 -1
  28. package/dist/test-helper.js +341 -1
  29. package/dist/type.js +21 -1
  30. package/dist/utility.js +139 -1
  31. package/package.json +23 -22
  32. package/dist/Lock.d.ts +0 -39
  33. package/dist/Logger.d.ts +0 -102
  34. package/dist/Semaphore.d.ts +0 -29
  35. package/dist/array.d.ts +0 -150
  36. package/dist/bundle/Lock.js +0 -1
  37. package/dist/bundle/Logger.js +0 -1
  38. package/dist/bundle/Semaphore.js +0 -1
  39. package/dist/bundle/array.js +0 -1
  40. package/dist/bundle/cli.js +0 -1
  41. package/dist/bundle/constants.js +0 -1
  42. package/dist/bundle/context.js +0 -1
  43. package/dist/bundle/cookie.js +0 -1
  44. package/dist/bundle/data-transfer.js +0 -1
  45. package/dist/bundle/datetime.js +0 -1
  46. package/dist/bundle/domNode.js +0 -1
  47. package/dist/bundle/expression/evaluators.js +0 -1
  48. package/dist/bundle/expression/helper.js +0 -1
  49. package/dist/bundle/expression/index.js +0 -1
  50. package/dist/bundle/expression/indicator-functions.js +0 -1
  51. package/dist/bundle/expression/types.js +0 -1
  52. package/dist/bundle/filesystem.js +0 -1
  53. package/dist/bundle/function.js +0 -1
  54. package/dist/bundle/index.js +0 -1
  55. package/dist/bundle/indicators.js +0 -1
  56. package/dist/bundle/number.js +0 -1
  57. package/dist/bundle/object.js +0 -1
  58. package/dist/bundle/process.js +0 -1
  59. package/dist/bundle/property-types.js +0 -1
  60. package/dist/bundle/require.js +0 -1
  61. package/dist/bundle/scope.js +0 -1
  62. package/dist/bundle/string.js +0 -1
  63. package/dist/bundle/test-helper.js +0 -1
  64. package/dist/bundle/type.js +0 -1
  65. package/dist/bundle/utility.js +0 -1
  66. package/dist/cli.d.ts +0 -31
  67. package/dist/compatible/Lock.js +0 -1
  68. package/dist/compatible/Logger.js +0 -1
  69. package/dist/compatible/Semaphore.js +0 -1
  70. package/dist/compatible/array.js +0 -1
  71. package/dist/compatible/cli.js +0 -1
  72. package/dist/compatible/constants.js +0 -1
  73. package/dist/compatible/context.js +0 -1
  74. package/dist/compatible/cookie.js +0 -1
  75. package/dist/compatible/data-transfer.js +0 -1
  76. package/dist/compatible/datetime.js +0 -1
  77. package/dist/compatible/domNode.js +0 -1
  78. package/dist/compatible/expression/evaluators.js +0 -1
  79. package/dist/compatible/expression/helper.js +0 -1
  80. package/dist/compatible/expression/index.js +0 -1
  81. package/dist/compatible/expression/indicator-functions.js +0 -1
  82. package/dist/compatible/expression/types.js +0 -1
  83. package/dist/compatible/filesystem.js +0 -1
  84. package/dist/compatible/function.js +0 -1
  85. package/dist/compatible/index.js +0 -1
  86. package/dist/compatible/indicators.js +0 -1
  87. package/dist/compatible/number.js +0 -1
  88. package/dist/compatible/object.js +0 -1
  89. package/dist/compatible/process.js +0 -1
  90. package/dist/compatible/property-types.js +0 -1
  91. package/dist/compatible/require.js +0 -1
  92. package/dist/compatible/scope.js +0 -1
  93. package/dist/compatible/string.js +0 -1
  94. package/dist/compatible/test-helper.js +0 -1
  95. package/dist/compatible/type.js +0 -1
  96. package/dist/compatible/utility.js +0 -1
  97. package/dist/constants.d.ts +0 -99
  98. package/dist/context.d.ts +0 -9
  99. package/dist/cookie.d.ts +0 -31
  100. package/dist/data-transfer.d.ts +0 -45
  101. package/dist/datetime.d.ts +0 -37
  102. package/dist/domNode.d.ts +0 -82
  103. package/dist/expression/evaluators.d.ts +0 -55
  104. package/dist/expression/helper.d.ts +0 -4
  105. package/dist/expression/index.d.ts +0 -7
  106. package/dist/expression/indicator-functions.d.ts +0 -14
  107. package/dist/expression/types.d.ts +0 -70
  108. package/dist/expression/types.js +0 -1
  109. package/dist/filesystem.d.ts +0 -138
  110. package/dist/function.d.ts +0 -20
  111. package/dist/index.d.ts +0 -23
  112. package/dist/indicators.d.ts +0 -68
  113. package/dist/number.d.ts +0 -35
  114. package/dist/object.d.ts +0 -213
  115. package/dist/process.d.ts +0 -22
  116. package/dist/property-types.d.ts +0 -460
  117. package/dist/require.d.ts +0 -6
  118. package/dist/scope.d.ts +0 -44
  119. package/dist/string.d.ts +0 -299
  120. package/dist/test/Lock.d.ts +0 -1
  121. package/dist/test/Logger.d.ts +0 -1
  122. package/dist/test/Semaphore.d.ts +0 -1
  123. package/dist/test/array.d.ts +0 -1
  124. package/dist/test/cookie.d.ts +0 -1
  125. package/dist/test/data-transfer.d.ts +0 -1
  126. package/dist/test/datetime.d.ts +0 -1
  127. package/dist/test/domNode.d.ts +0 -1
  128. package/dist/test/expression/evaluators.d.ts +0 -1
  129. package/dist/test/expression/helper.d.ts +0 -1
  130. package/dist/test/expression/indicator-functions.d.ts +0 -1
  131. package/dist/test/filesystem.d.ts +0 -1
  132. package/dist/test/function.d.ts +0 -1
  133. package/dist/test/indicators.d.ts +0 -1
  134. package/dist/test/number.d.ts +0 -1
  135. package/dist/test/object.d.ts +0 -1
  136. package/dist/test/process.d.ts +0 -1
  137. package/dist/test/property-types.d.ts +0 -1
  138. package/dist/test/scope.d.ts +0 -1
  139. package/dist/test/string.d.ts +0 -1
  140. package/dist/test/utility.d.ts +0 -1
  141. package/dist/test-helper.d.ts +0 -143
  142. package/dist/type.d.ts +0 -211
  143. package/dist/utility.d.ts +0 -44
package/dist/utility.js CHANGED
@@ -1 +1,139 @@
1
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter(function(path){return eval("require.main.paths").includes(path)})))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var n=r();for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(this,function(){return function(){var __webpack_modules__={1:function(e,r,n){n.d(r,{NOOP:function(){return c}});var t,o,u=n(5);e=n.hmd(e);var i="undefined"==typeof globalThis?void 0===window?void 0===n.g?e:Object.prototype.hasOwnProperty.call(n.g,"window")?n.g.window:n.g:window:globalThis;i.fetch=i.fetch?i.fetch.bind(i):null!==(t=null==(o=(0,u.optionalRequire)("node-fetch"))?void 0:o.default)&&void 0!==t?t:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return u.currentImport?(0,u.currentImport)("node-fetch").then(function(e){var n;return(n=e).default.apply(n,r)}):null};var c=function(){}},4:function(e,r,n){n.d(r,{isFunction:function(){return t}});var t=function(e){return Boolean(e)&&["[object AsyncFunction]","[object Function]"].includes({}.toString.call(e))}},5:function(module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{currentImport:function(){return currentImport},optionalRequire:function(){return optionalRequire}});var currentRequire=eval("typeof require === 'undefined' ? null : require"),currentOptionalImport=null;try{currentOptionalImport=eval("typeof import === 'undefined' ? null : import")}catch(e){}var currentImport=currentOptionalImport,optionalRequire=function(e){try{return currentRequire?currentRequire(e):null}catch(e){return null}},clearRequireCache=function(e){void 0===e&&(e=(null==currentRequire?void 0:currentRequire.cache)||__webpack_require__.c);for(var r={},n=0,t=Object.entries(e);n<t.length;n++){var o=t[n],u=o[0],i=o[1];r[u]=i,delete e[u]}return r},restoreRequireCache=function(e,r){void 0===e&&(e=(null==currentRequire?void 0:currentRequire.cache)||__webpack_require__.c),clearRequireCache();for(var n=0,t=Object.entries(r);n<t.length;n++){var o=t[n],u=o[0],i=o[1];e[u]=i}},isolatedRequire=function(e,r){void 0===r&&(r=currentRequire||__webpack_require__(6));var n=clearRequireCache(r.cache);try{return r(e)}catch(e){throw e}finally{restoreRequireCache(r.cache,n)}}},15:function(e,r,n){n.r(r),n.d(r,{debounce:function(){return i},preventDefault:function(){return a},stopPropagation:function(){return l},timeout:function(){return c},trailingThrottle:function(){return u}});var t=n(1),o=n(4),u=function(e,r){void 0===r&&(r=600);for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];var u=null,i=[];return function(){for(var n=arguments.length,o=new Array(n),c=0;c<n;c++)o[c]=arguments[c];i=o,u||(u=setTimeout(function(){e.apply(void 0,i.concat(t)),u=null,i=[]},r))}},i=function(e,r){void 0===r&&(r=600);for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];var u,i,a=new Promise(function(e){i=e});return function(){for(var n,o=arguments.length,l=new Array(o),_=0;_<o;_++)l[_]=arguments[_];return l=l.concat(t),null==(n=u)||n.clear(),u=c(function(){i(e.apply(void 0,l)),a=new Promise(function(e){i=e})},r),a}},c=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];for(var u,i,c=t.NOOP,a=0,l=!1,_=0,f=r;_<f.length;_++){var p=f[_];"number"!=typeof p||isNaN(p)?"boolean"==typeof p?l=p:(0,o.isFunction)(p)&&(c=p):a=p}var d=new Promise(function(e,r){u=r,i=e}),s=function(){var e;(e=c).call.apply(e,[d].concat(r)),i(!1)},v=2147483647;if(a<=v)d.timeoutID=setTimeout(s,a);else{var m=Math.floor(a/v),w=a%v,b=function(){m>0?(m-=1,d.timeoutID=setTimeout(b,v)):d.timeoutID=setTimeout(s,w)};b()}return d.clear=function(){Object.prototype.hasOwnProperty.call(d,"timeoutID")&&(clearTimeout(d.timeoutID),(l?u:i)(!0))},d},a=function(e){e.preventDefault()},l=function(e){e.stopPropagation()}},6:function(e){function r(e){var r=new Error("Cannot find module '"+e+"'");throw r.code="MODULE_NOT_FOUND",r}r.keys=function(){return[]},r.resolve=r,r.id=6,e.exports=r}},__webpack_module_cache__={};function __webpack_require__(e){var r=__webpack_module_cache__[e];if(void 0!==r)return r.exports;var n=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.loaded=!0,n.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.d=function(e,r){for(var n in r)__webpack_require__.o(r,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__=__webpack_require__(15);return __webpack_exports__}()});
1
+ // #!/usr/bin/env babel-node
2
+ // -*- coding: utf-8 -*-
3
+ /** @module utility */
4
+ 'use strict';
5
+
6
+ /* !
7
+ region header
8
+ [Project page](https://torben.website/clientnode)
9
+
10
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
11
+
12
+ License
13
+ -------
14
+
15
+ This library written by Torben Sickert stands under a creative commons
16
+ naming 3.0 unported license.
17
+ See https://creativecommons.org/licenses/by/3.0/deed.de
18
+ endregion
19
+ */
20
+ import { NOOP } from "./context.js";
21
+ import { isFunction } from "./indicators.js";
22
+
23
+ /**
24
+ * Prevents event functions from triggering too often by defining a minimal
25
+ * span between each function call. Additional arguments given to this function
26
+ * will be forwarded to the given event function call.
27
+ * @param callback - The function to call debounced.
28
+ * @param thresholdInMilliseconds - The minimum time span between each
29
+ * function call.
30
+ * @param additionalArguments - Additional arguments to forward to given
31
+ * function.
32
+ * @returns Returns the wrapped method.
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
+ /**
50
+ * Prevents event functions from triggering too close after each trigger by
51
+ * defining a minimal span between each function call. Additional arguments
52
+ * given to this function will be forwarded to the given event function call.
53
+ * @param callback - The function to call debounced.
54
+ * @param thresholdInMilliseconds - The minimum time span between each
55
+ * function call.
56
+ * @param additionalArguments - Additional arguments to forward to given
57
+ * function.
58
+ * @returns Returns the wrapped method.
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
+ /**
79
+ * Triggers given callback after given duration. Supports unlimited
80
+ * duration length and returns a promise which will be resolved after given
81
+ * duration has been passed.
82
+ * @param parameters - Observes the first three existing parameters. If one
83
+ * is a number it will be interpreted as delay in milliseconds until given
84
+ * callback will be triggered. If one is of type function it will be used
85
+ * as callback and if one is of type boolean it will indicate if returning
86
+ * promise should be rejected or resolved if given internally created
87
+ * timeout should be canceled. Additional parameters will be forwarded to
88
+ * given callback.
89
+ * @returns A promise resolving after given delay or being rejected if
90
+ * value "true" is within one of the first three parameters. The promise
91
+ * holds a boolean indicating whether timeout has been canceled or
92
+ * resolved.
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,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL3V0aWxpdHkudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gIyEvdXNyL2Jpbi9lbnYgYmFiZWwtbm9kZVxuLy8gLSotIGNvZGluZzogdXRmLTggLSotXG4vKiogQG1vZHVsZSB1dGlsaXR5ICovXG4ndXNlIHN0cmljdCdcbi8qICFcbiAgICByZWdpb24gaGVhZGVyXG4gICAgW1Byb2plY3QgcGFnZV0oaHR0cHM6Ly90b3JiZW4ud2Vic2l0ZS9jbGllbnRub2RlKVxuXG4gICAgQ29weXJpZ2h0IFRvcmJlbiBTaWNrZXJ0IChpbmZvW1wifmF0flwiXXRvcmJlbi53ZWJzaXRlKSAxNi4xMi4yMDEyXG5cbiAgICBMaWNlbnNlXG4gICAgLS0tLS0tLVxuXG4gICAgVGhpcyBsaWJyYXJ5IHdyaXR0ZW4gYnkgVG9yYmVuIFNpY2tlcnQgc3RhbmRzIHVuZGVyIGEgY3JlYXRpdmUgY29tbW9uc1xuICAgIG5hbWluZyAzLjAgdW5wb3J0ZWQgbGljZW5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HMgPD0gbWF4aW11bVRpbWVvdXREZWxheUluTWlsbGlzZWNvbmRzKVxuICAgICAgICByZXN1bHQudGltZW91dElEID0gc2V0VGltZW91dCh3cmFwcGVkQ2FsbGJhY2ssIGRlbGF5SW5NaWxsaXNlY29uZHMpXG4gICAgZWxzZSB7XG4gICAgICAgIC8qXG4gICAgICAgICAgICBEZXRlcm1pbmUgdGhlIG51bWJlciBvZiB0aW1lcyB3ZSBuZWVkIHRvIGRlbGF5IGJ5IG1heGltdW1cbiAgICAgICAgICAgIHBvc3NpYmxlIHRpbWVvdXQgZHVyYXRpb24uXG4gICAgICAgICovXG4gICAgICAgIGxldCBudW1iZXJPZlJlbWFpbmluZ1RpbWVvdXRzOiBudW1iZXIgPSBNYXRoLmZsb29yKFxuICAgICAgICAgICAgZGVsYXlJbk1pbGxpc2Vjb25kcyAvIG1heGltdW1UaW1lb3V0RGVsYXlJbk1pbGxpc2Vjb25kc1xuICAgICAgICApXG4gICAgICAgIGNvbnN0IGZpbmFsVGltZW91dER1cmF0aW9uOiBudW1iZXIgPVxuICAgICAgICAgICAgZGVsYXlJbk1pbGxpc2Vjb25kcyAlIG1heGltdW1UaW1lb3V0RGVsYXlJbk1pbGxpc2Vjb25kc1xuXG4gICAgICAgIGNvbnN0IGRlbGF5ID0gKCkgPT4ge1xuICAgICAgICAgICAgaWYgKG51bWJlck9mUmVtYWluaW5nVGltZW91dHMgPiAwKSB7XG4gICAgICAgICAgICAgICAgbnVtYmVyT2ZSZW1haW5pbmdUaW1lb3V0cyAtPSAxXG5cbiAgICAgICAgICAgICAgICByZXN1bHQudGltZW91dElEID1cbiAgICAgICAgICAgICAgICAgICAgc2V0VGltZW91dChkZWxheSwgbWF4aW11bVRpbWVvdXREZWxheUluTWlsbGlzZWNvbmRzKVxuICAgICAgICAgICAgfSBlbHNlXG4gICAgICAgICAgICAgICAgcmVzdWx0LnRpbWVvdXRJRCA9XG4gICAgICAgICAgICAgICAgICAgIHNldFRpbWVvdXQod3JhcHB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EtBQVksSUFBSztFQUM1QyxLQUFLLENBQUMsY0FBYyxDQUFDLENBQUM7QUFDMUIsQ0FBQztBQUNELE9BQU8sTUFBTSxlQUFlLEdBQUksS0FBWSxJQUFLO0VBQzdDLEtBQUssQ0FBQyxlQUFlLENBQUMsQ0FBQztBQUMzQixDQUFDIiwiaWdub3JlTGlzdCI6W119
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clientnode",
3
- "version": "4.0.1428",
3
+ "version": "4.0.1430",
4
4
  "description": "Handy utilities for any JavaScript environments.",
5
5
  "keywords": [
6
6
  "client",
@@ -16,6 +16,7 @@
16
16
  },
17
17
  "license": "CC-BY-3.0",
18
18
  "main": "dist/index.js",
19
+ "type": "module",
19
20
  "exports": {
20
21
  ".": "./dist/index.js",
21
22
  "./dist/*": "./dist/*",
@@ -47,10 +48,10 @@
47
48
  },
48
49
  "scripts": {
49
50
  "build": "yarn build:types; yarn build:plain; yarn build:compatible; yarn build:bundle; yarn build:bundle:compatible",
50
- "build:alternate": "command='node_modules/.bin/babel --plugins @babel/plugin-proposal-class-properties,@babel/plugin-transform-runtime --presets @babel/preset-env,@babel/preset-typescript --source-maps inline --out-file'; for name in array cli cookie constants context data-transfer datetime filesystem function index indicators Logger Lock number object process property-types require scope Semaphore string type utility; do $command \"dist/${name}.js\" \"src/${name}.ts\"; done; yarn make:executable",
51
- "build:compatible": "yarn build:types; weboptimizer build '{__reference__: \"target:compatible\"}'",
51
+ "build:standalone": "npx babel --config-file ./standalone.babel.config.json --source-maps inline --extensions .ts,.tsx --ignore 'src/test/**' --out-dir dist src; yarn make:executable",
52
+ "build:compatible": "weboptimizer build '{__reference__: \"target:compatible\"}'",
52
53
  "build:bundle": "weboptimizer build '{__reference__: \"target:bundle\"}'",
53
- "build:bundle:compatible": "yarn build:types; weboptimizer build '{__reference__: [\"target:bundle\", \"target:compatible\"]}'",
54
+ "build:bundle:compatible": "weboptimizer build '{__reference__: [\"target:bundle\", \"target:compatible\"]}'",
54
55
  "build:plain": "weboptimizer build",
55
56
  "build:types": "weboptimizer build:types",
56
57
  "check": "yarn check:types; yarn lint",
@@ -59,7 +60,7 @@
59
60
  "document": "weboptimizer document",
60
61
  "lint": "weboptimizer lint",
61
62
  "make:executable": "node --eval \"fs.chmodSync('dist/index.js', '700')\"",
62
- "prepare": "if ! yarn build; then echo You should rerun install procedure to resolve dependency cycle. && yarn build:alternate; fi",
63
+ "prepare": "if ! yarn build; then echo You should rerun install procedure to resolve dependency cycle. && yarn build:standalone; fi",
63
64
  "serve": "weboptimizer serve",
64
65
  "start": "yarn serve",
65
66
  "test": "weboptimizer test",
@@ -70,24 +71,28 @@
70
71
  "watch": "weboptimizer build --watch"
71
72
  },
72
73
  "devDependencies": {
73
- "@babel/cli": "^7.29.7",
74
- "@babel/eslint-parser": "^7.29.7",
75
- "@babel/plugin-transform-proto-to-assign": "^7.29.7",
76
- "@babel/runtime": "^7.29.7",
74
+ "@babel/cli": "^8.0.1",
75
+ "@babel/eslint-parser": "^8.0.1",
76
+ "@babel/plugin-transform-class-properties": "^8.0.1",
77
+ "@babel/preset-env": "^8.0.2",
78
+ "@babel/preset-typescript": "^8.0.1",
79
+ "@babel/runtime": "^8.0.0",
77
80
  "@eslint/js": "^10.0.1",
78
81
  "@stylistic/eslint-plugin": "^5.10.0",
79
82
  "@types/ejs": "^3.1.5",
80
83
  "@types/html-minifier": "^4.0.6",
81
84
  "@types/imagemin": "^9.0.1",
82
- "@types/node": "^26.0.0",
85
+ "@types/node": "^26.1.0",
83
86
  "@types/prop-types": "^15.7.15",
84
87
  "@types/webpack-env": "^1.18.8",
85
- "@typescript-eslint/eslint-plugin": "^8.62.0",
86
- "@typescript-eslint/parser": "^8.62.0",
88
+ "@typescript-eslint/eslint-plugin": "^8.62.1",
89
+ "@typescript-eslint/parser": "^8.62.1",
90
+ "babel-plugin-polyfill-corejs3": "^1.0.0",
91
+ "babel-plugin-transform-rewrite-imports": "^1.5.4",
87
92
  "clientnode": "workspace:.",
88
- "eslint": "^10.5.0",
93
+ "eslint": "^10.6.0",
89
94
  "eslint-config-google": "^0.14.0",
90
- "eslint-plugin-jsdoc": "^63.0.7",
95
+ "eslint-plugin-jsdoc": "^63.0.10",
91
96
  "favicons-webpack-plugin": "^6.0.1",
92
97
  "image-minimizer-webpack-plugin": "^5.0.0",
93
98
  "jest": "30.4.2",
@@ -95,21 +100,17 @@
95
100
  "node-fetch": "^3.3.2",
96
101
  "prop-types": "^15.8.1",
97
102
  "rimraf": "^6.1.3",
98
- "typescript-eslint": "^8.62.0",
99
- "web-documentation": "^1.0.41",
100
- "weboptimizer": "^3.0.28",
103
+ "typescript-eslint": "^8.62.1",
104
+ "web-documentation": "^1.0.42",
105
+ "weboptimizer": "^4.0.3",
101
106
  "webpack-dev-server": "^5.2.5"
102
107
  },
103
108
  "peerDependencies": {
104
- "@babel/runtime": "*",
105
109
  "@types/prop-types": "*",
106
110
  "node-fetch": "*",
107
111
  "prop-types": "*"
108
112
  },
109
113
  "peerDependenciesMeta": {
110
- "@babel/runtime": {
111
- "optional": true
112
- },
113
114
  "@types/prop-types": {
114
115
  "optional": true
115
116
  },
@@ -227,7 +228,7 @@
227
228
  "javaScript": {
228
229
  "options": {
229
230
  "plugins": {
230
- "__remove__": "@babel/plugin-transform-runtime"
231
+ "__remove__": 1
231
232
  }
232
233
  }
233
234
  }
package/dist/Lock.d.ts DELETED
@@ -1,39 +0,0 @@
1
- import { 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;
package/dist/Logger.d.ts DELETED
@@ -1,102 +0,0 @@
1
- import { LoggerOptions, Mapping } from './type';
2
- export declare const LEVELS: readonly ["error", "critical", "warn", "info", "debug"];
3
- export declare const LEVELS_COLOR: ("\u001B[0;34m" | "\u001B[32m" | "\u001B[35m" | "\u001B[31m" | "\u001B[33m")[];
4
- export type Level = typeof LEVELS[number];
5
- /**
6
- * This plugin provides such interface logic like generic controller logic for
7
- * integrating plugins into $, mutual exclusion for dependent gui elements,
8
- * logging additional string, array or function handling. A set of helper
9
- * functions to parse option objects dom trees or handle events is also
10
- * provided.
11
- * @property level - Logging level.
12
- * @property name - Logger description.
13
- */
14
- export declare class Logger {
15
- static defaultLevel: Level;
16
- static defaultName: string;
17
- static selfClass: typeof Logger;
18
- static instances: Mapping<Logger>;
19
- static runtimeVersion: number;
20
- /**
21
- * Configures all logger instances.
22
- * @param options - Options to set.
23
- */
24
- static configureAllInstances(options?: Partial<LoggerOptions>): void;
25
- level: Level;
26
- name: string;
27
- /**
28
- * Initializes logger.
29
- * @param options - Options to set.
30
- */
31
- constructor(options?: Partial<LoggerOptions>);
32
- /**
33
- * Configures logger.
34
- * @param options - Options to set.
35
- * @param options.name - Description of the logger instance.
36
- * @param options.level - Logging level to configure.
37
- */
38
- configure({ name, level }: Partial<LoggerOptions>): void;
39
- /**
40
- * Shows the given object's representation in the browsers console if
41
- * possible or in a standalone alert-window as fallback.
42
- * @param object - Any object to print.
43
- * @param force - If set to "true" given input will be shown independently
44
- * of current logging configuration or interpreter's console
45
- * implementation.
46
- * @param avoidAnnotation - If set to "true" given input has no module or
47
- * log level specific annotations.
48
- * @param level - Description of log messages importance.
49
- * @param additionalArguments - Additional values to print.
50
- */
51
- log(object: unknown, force?: boolean, avoidAnnotation?: boolean, level?: Level, ...additionalArguments: Array<unknown>): void;
52
- /**
53
- * Wrapper method for the native console method usually provided by
54
- * interpreter.
55
- * @param object - Any object to print.
56
- * @param additionalArguments - Additional arguments are used for string
57
- * formatting.
58
- */
59
- info(object: unknown, ...additionalArguments: Array<unknown>): void;
60
- /**
61
- * Wrapper method for the native console method usually provided by
62
- * interpreter.
63
- * @param object - Any object to print.
64
- * @param additionalArguments - Additional arguments are used for string
65
- * formatting.
66
- */
67
- debug(object: unknown, ...additionalArguments: Array<unknown>): void;
68
- /**
69
- * Wrapper method for the native console method usually provided by
70
- * interpreter.
71
- * @param object - Any object to print.
72
- * @param additionalArguments - Additional arguments are used for string
73
- * formatting.
74
- */
75
- error(object: unknown, ...additionalArguments: Array<unknown>): void;
76
- /**
77
- * Wrapper method for the native console method usually provided by
78
- * interpreter.
79
- * @param object - Any object to print.
80
- * @param additionalArguments - Additional arguments are used for string
81
- * formatting.
82
- */
83
- critical(object: unknown, ...additionalArguments: Array<unknown>): void;
84
- /**
85
- * Wrapper method for the native console method usually provided by
86
- * interpreter.
87
- * @param object - Any object to print.
88
- * @param additionalArguments - Additional arguments are used for string
89
- * formatting.
90
- */
91
- warn(object: unknown, ...additionalArguments: Array<unknown>): void;
92
- /**
93
- * Dumps a given object in a human-readable format.
94
- * @param object - Any object to show.
95
- * @param level - Number of levels to dig into given object recursively.
96
- * @param currentLevel - Maximal number of recursive function calls to
97
- * represent given object.
98
- * @returns Returns the serialized version of given object.
99
- */
100
- static show(object: unknown, level?: number, currentLevel?: number): string;
101
- }
102
- export default Logger;
@@ -1,29 +0,0 @@
1
- import { AnyFunction } from './type';
2
- /**
3
- * Represents the semaphore state.
4
- * @property queue - List of waiting resource requests.
5
- * @property numberOfFreeResources - Number free allowed concurrent resource
6
- * uses.
7
- * @property numberOfResources - Number of allowed concurrent resource uses.
8
- */
9
- export declare class Semaphore {
10
- queue: Array<AnyFunction>;
11
- numberOfResources: number;
12
- numberOfFreeResources: number;
13
- /**
14
- * Initializes number of resources.
15
- * @param numberOfResources - Number of resources to manage.
16
- */
17
- constructor(numberOfResources?: number);
18
- /**
19
- * Acquires a new resource and runs given callback if available.
20
- * @returns A promise which will be resolved if requested resource is
21
- * available.
22
- */
23
- acquire(): Promise<number>;
24
- /**
25
- * Releases a resource and runs a waiting resolver if there exists some.
26
- */
27
- release(): void;
28
- }
29
- export default Semaphore;
package/dist/array.d.ts DELETED
@@ -1,150 +0,0 @@
1
- import { Mapping, Page, PaginateOptions } from './type';
2
- /**
3
- * Summarizes given property of given item list.
4
- * @param data - Array of objects with given property name.
5
- * @param propertyName - Property name to summarize.
6
- * @param defaultValue - Value to return if property values doesn't match.
7
- * @returns Aggregated value.
8
- */
9
- export declare const aggregatePropertyIfEqual: <T = unknown>(data: Array<Mapping<unknown>>, propertyName: string, defaultValue?: T) => T;
10
- /**
11
- * Deletes every item witch has only empty attributes for given property names.
12
- * If given property names are empty each attribute will be considered. The
13
- * empty string, "null" and "undefined" will be interpreted as empty.
14
- * @param data - Data to filter.
15
- * @param propertyNames - Properties to consider.
16
- * @returns Given data without empty items.
17
- */
18
- export declare const deleteEmptyItems: <T extends Mapping<unknown> = Mapping<unknown>>(data: Array<T>, propertyNames?: Array<string | symbol>) => Array<T>;
19
- /**
20
- * Extracts all properties from all items which occur in given property names.
21
- * @param data - Data where each item should be sliced.
22
- * @param propertyNames - Property names to extract.
23
- * @returns Data with sliced items.
24
- */
25
- export declare const extract: <T = Mapping<unknown>>(data: unknown, propertyNames: Array<string>) => Array<T>;
26
- /**
27
- * Extracts all values which matches given regular expression.
28
- * @param data - Data to filter.
29
- * @param regularExpression - Pattern to match for.
30
- * @returns Filtered data.
31
- */
32
- export declare const extractIfMatches: (data: unknown, regularExpression: string | RegExp) => Array<string>;
33
- /**
34
- * Filters given data if given property is set or not.
35
- * @param data - Data to filter.
36
- * @param propertyName - Property name to check for existence.
37
- * @returns Given data without the items which doesn't have specified property.
38
- */
39
- export declare const extractIfPropertyExists: <T extends Mapping<unknown> = Mapping<unknown>>(data: unknown, propertyName: string) => Array<T>;
40
- /**
41
- * Extract given data where specified property value matches given patterns.
42
- * @param data - Data to filter.
43
- * @param propertyPattern - Mapping of property names to pattern.
44
- * @returns Filtered data.
45
- */
46
- export declare const extractIfPropertyMatches: <T = unknown>(data: unknown, propertyPattern: Mapping<RegExp | string>) => Array<T>;
47
- /**
48
- * Determines all objects which exists in "first" and in "second".
49
- * Object key which will be compared are given by "keys". If an empty array is
50
- * given each key will be compared. If an object is given corresponding initial
51
- * data key will be mapped to referenced new data key.
52
- * @param first - Referenced data to check for.
53
- * @param second - Data to check for existence.
54
- * @param keys - Keys to define equality.
55
- * @param strict - The strict parameter indicates whether "null" and
56
- * "undefined" should be interpreted as equal (takes only effect if given keys
57
- * aren't empty).
58
- * @returns Data which does exit in given initial data.
59
- */
60
- export declare const intersect: <T = unknown>(first: unknown, second: unknown, keys?: Array<string> | Mapping<number | string>, strict?: boolean) => Array<T>;
61
- /**
62
- * Converts given object into an array.
63
- * @param object - Target to convert.
64
- * @returns Generated array.
65
- */
66
- export declare const makeArray: <T = unknown>(object: unknown) => Array<T>;
67
- /**
68
- * Creates a list of items within given range.
69
- * @param range - Array of lower and upper bounds. If only one value is given
70
- * lower bound will be assumed to be zero. Both integers have to be positive
71
- * and will be contained in the resulting array. If more than two numbers are
72
- * provided given range will be returned.
73
- * @param step - Space between two consecutive values.
74
- * @param ignoreLastStep - Removes last step.
75
- * @returns Produced array of integers.
76
- */
77
- export declare const makeRange: (range: number | Array<number> | [number] | [number, number], step?: number, ignoreLastStep?: boolean) => Array<number>;
78
- /**
79
- * Merge the contents of two arrays together into the first array.
80
- * @param target - Target array.
81
- * @param source - Source array.
82
- * @returns Target array with merged given source one.
83
- */
84
- export declare const merge: <T = unknown>(target: Array<T>, source: Array<T>) => Array<T>;
85
- /**
86
- * Generates a list if pagination symbols to render a pagination from.
87
- * @param options - Configure bounds and current page of pagination to
88
- * determine.
89
- * @param options.boundaryCount - Indicates where to start pagination within
90
- * given total range.
91
- * @param options.disabled - Indicates whether to disable all items.
92
- * @param options.hideNextButton - Indicates whether to show a jump to next
93
- * item.
94
- * @param options.hidePrevButton - Indicates whether to show a jump to previous
95
- * item.
96
- * @param options.page - Indicates current visible page.
97
- * @param options.pageSize - Number of items per page.
98
- * @param options.showFirstButton - Indicates whether to show a jump to first
99
- * item.
100
- * @param options.showLastButton - Indicates whether to show a jump to last
101
- * item.
102
- * @param options.siblingCount - Number of sibling page symbols next to current
103
- * page symbol.
104
- * @param options.total - Number of all items to paginate.
105
- * @returns A list of pagination symbols.
106
- */
107
- export declare const paginate: (options?: Partial<PaginateOptions>) => Array<Page>;
108
- /**
109
- * Generates all permutations of given iterable.
110
- * @param data - Array like object.
111
- * @returns Array of permuted arrays.
112
- */
113
- export declare const permute: <T = unknown>(data: Array<T>) => Array<Array<T>>;
114
- /**
115
- * Generates all lengths permutations of given iterable.
116
- * @param data - Array like object.
117
- * @param minimalSubsetLength - Defines how long the minimal subset length
118
- * should be.
119
- * @returns Array of permuted arrays.
120
- */
121
- export declare const permuteLength: <T = unknown>(data: Array<T>, minimalSubsetLength?: number) => Array<Array<T>>;
122
- /**
123
- * Sums up given property of given item list.
124
- * @param data - The objects with specified property to sum up.
125
- * @param propertyName - Property name to sum up its value.
126
- * @returns The aggregated value.
127
- */
128
- export declare const sumUpProperty: (data: unknown, propertyName: string) => number;
129
- /**
130
- * Removes given target on given list.
131
- * @param list - Array to splice.
132
- * @param target - Target to remove from given list.
133
- * @param strict - Indicates whether to fire an exception if given target
134
- * doesn't exist given list.
135
- * @returns Item with the appended target.
136
- */
137
- export declare const removeArrayItem: <T = unknown>(list: Array<T>, target: T, strict?: boolean) => Array<T>;
138
- /**
139
- * Sorts given object of dependencies in a topological order.
140
- * @param items - Items to sort.
141
- * @returns Sorted array of given items respecting their dependencies.
142
- */
143
- export declare const sortTopological: (items: Mapping<Array<string> | string>) => Array<string>;
144
- /**
145
- * Makes all values in given iterable unique by removing duplicates (The first
146
- * occurrences will be left).
147
- * @param data - Array like object.
148
- * @returns Sliced version of given object.
149
- */
150
- export declare const unique: <T = unknown>(data: Array<T>) => Array<T>;
@@ -1 +0,0 @@
1
- "use strict";if("undefined"!=typeof module&&null!==module&&"undefined"!==eval("typeof require")&&null!==eval("require")&&"main"in eval("require")&&"undefined"!==eval("typeof require.main")&&null!==eval("require.main")){var ORIGINAL_MAIN_MODULE=module;module!==eval("require.main")&&"paths"in module&&"paths"in eval("require.main")&&"undefined"!=typeof __dirname&&null!==__dirname&&(module.paths=eval("require.main.paths").concat(module.paths.filter(function(path){return eval("require.main.paths").includes(path)})))}if(null==window)var window="undefined"==typeof global||null===global?{}:global;!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("clientnode",[],t):"object"==typeof exports?exports.clientnode=t():e.clientnode=t()}(this,function(){return function(){var e={d:function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};function n(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",u=o.toStringTag||"@@toStringTag";function a(n,o,i,u){var a=o&&o.prototype instanceof l?o:l,f=Object.create(a.prototype);return r(f,"_invoke",function(n,r,o){var i,u,a,l=0,f=o||[],s=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return i=t,u=0,a=e,p.n=n,c}};function d(n,r){for(u=n,a=r,t=0;!s&&l&&!o&&t<f.length;t++){var o,i=f[t],d=p.p,v=i[2];n>3?(o=v===r)&&(a=i[(u=i[4])?5:(u=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=n<2&&d<i[1])?(u=0,p.v=r,p.n=i[1]):d<v&&(o=n<3||i[0]>r||r>v)&&(i[4]=n,i[5]=r,p.n=v,u=0))}if(o||n>1)return c;throw s=!0,r}return function(o,f,v){if(l>1)throw TypeError("Generator is already running");for(s&&1===f&&d(f,v),u=f,a=v;(t=u<2?e:a)||!s;){i||(u?u<3?(u>1&&(p.n=-1),d(u,a)):p.n=a:p.v=a);try{if(l=2,i){if(u||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,u<2&&(u=0)}else 1===u&&(t=i.return)&&t.call(i),u<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),u=1);i=e}else if((t=(s=p.n<0)?a:n.call(r,p))!==c)break}catch(t){i=e,u=1,a=t}finally{l=1}}return{value:t,done:s}}}(n,i,u),!0),f}var c={};function l(){}function f(){}function s(){}t=Object.getPrototypeOf;var p=[][i]?t(t([][i]())):(r(t={},i,function(){return this}),t),d=s.prototype=l.prototype=Object.create(p);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,r(e,u,"GeneratorFunction")),e.prototype=Object.create(d),e}return f.prototype=s,r(d,"constructor",s),r(s,"constructor",f),f.displayName="GeneratorFunction",r(s,u,"GeneratorFunction"),r(d),r(d,u,"Generator"),r(d,i,function(){return this}),r(d,"toString",function(){return"[object Generator]"}),(n=function(){return{w:a,m:v}})()}function r(e,t,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}r=function(e,t,n,o){function u(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(u("next",0),u("throw",1),u("return",2))},r(e,t,n,o)}function o(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,o)}e.r(t),e.d(t,{Lock:function(){return i}});var i=function(){function e(e){void 0===e&&(e={}),this.lock=void 0,this.locks=void 0,this.locks=e}var t=e.prototype;return t.acquire=function(e,t,n){var r=this;return void 0===n&&(n=!1),new Promise(function(o){var i=function(e){var i,u;t&&(u=t(e));var a=function(t){return n&&r.release(e),o(t),t};return null!=(i=u)&&i.then?u.then(a):(a(u),u)};e?Object.prototype.hasOwnProperty.call(r.locks,e)?r.locks[e].push(i):(r.locks[e]=[],i(e)):r.lock?r.lock.push(i):(r.lock=[],i(e))})},t.release=function(){var e,t=(e=n().m(function e(t){var r,o,i;return n().w(function(e){for(;;)switch(e.n){case 0:if(!t){e.n=4;break}if(!Object.prototype.hasOwnProperty.call(this.locks,t)){e.n=3;break}if(void 0!==(o=this.locks[t].shift())){e.n=1;break}delete this.locks[t],e.n=3;break;case 1:return e.n=2,o(t);case 2:case 6:return e.a(2,e.v);case 3:case 7:return e.a(2);case 4:if(void 0!==(i=null==(r=this.lock)?void 0:r.shift())){e.n=5;break}this.lock=void 0,e.n=7;break;case 5:return e.n=6,i()}},e,this)}),function(){var t=this,n=arguments;return new Promise(function(r,i){var u=e.apply(t,n);function a(e){o(u,r,i,a,c,"next",e)}function c(e){o(u,r,i,a,c,"throw",e)}a(void 0)})});return function(e){return t.apply(this,arguments)}}(),e}();return t.default=i,t}()});