clientnode 4.0.1493 → 4.0.1495

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 (113) hide show
  1. package/dist/Lock.d.ts +39 -0
  2. package/dist/Lock.js +68 -83
  3. package/dist/Logger.d.ts +102 -0
  4. package/dist/Logger.js +693 -163
  5. package/dist/Semaphore.d.ts +29 -0
  6. package/dist/Semaphore.js +55 -46
  7. package/dist/array.d.ts +150 -0
  8. package/dist/array.js +545 -337
  9. package/dist/bundle/index.js +4512 -0
  10. package/dist/cli.d.ts +31 -0
  11. package/dist/cli.js +44 -37
  12. package/dist/compatible/Lock.js +85 -0
  13. package/dist/compatible/Logger.js +715 -0
  14. package/dist/compatible/Semaphore.js +74 -0
  15. package/dist/compatible/array.js +660 -0
  16. package/dist/compatible/cli.js +58 -0
  17. package/dist/compatible/constants.js +200 -0
  18. package/dist/compatible/context.js +224 -0
  19. package/dist/compatible/cookie.js +240 -0
  20. package/dist/compatible/data-transfer.js +751 -0
  21. package/dist/compatible/datetime.js +1088 -0
  22. package/dist/compatible/domNode.js +481 -0
  23. package/dist/compatible/expression/evaluators.js +1152 -0
  24. package/dist/compatible/expression/helper.js +115 -0
  25. package/dist/compatible/expression/index.js +1274 -0
  26. package/dist/compatible/expression/indicator-functions.js +224 -0
  27. package/dist/compatible/expression/type.js +16 -0
  28. package/dist/compatible/filesystem.js +373 -0
  29. package/dist/compatible/function.js +114 -0
  30. package/dist/compatible/index.js +3081 -0
  31. package/dist/compatible/indicators.js +471 -0
  32. package/dist/compatible/module.js +168 -0
  33. package/dist/compatible/number.js +433 -0
  34. package/dist/compatible/object.js +1042 -0
  35. package/dist/compatible/process.js +230 -0
  36. package/dist/compatible/property-types.js +36 -0
  37. package/dist/compatible/scope.js +2016 -0
  38. package/dist/compatible/string.js +1156 -0
  39. package/dist/compatible/test-helper.js +837 -0
  40. package/dist/compatible/type.js +16 -0
  41. package/dist/compatible/utility.js +358 -0
  42. package/dist/constants.d.ts +99 -0
  43. package/dist/constants.js +184 -110
  44. package/dist/context.d.ts +8 -0
  45. package/dist/context.js +209 -25
  46. package/dist/cookie.d.ts +31 -0
  47. package/dist/cookie.js +204 -48
  48. package/dist/data-transfer.d.ts +45 -0
  49. package/dist/data-transfer.js +701 -166
  50. package/dist/datetime.d.ts +37 -0
  51. package/dist/datetime.js +1047 -245
  52. package/dist/domNode.d.ts +82 -0
  53. package/dist/domNode.js +427 -277
  54. package/dist/expression/evaluators.d.ts +55 -0
  55. package/dist/expression/evaluators.js +1113 -234
  56. package/dist/expression/helper.d.ts +4 -0
  57. package/dist/expression/helper.js +100 -82
  58. package/dist/expression/index.d.ts +7 -0
  59. package/dist/expression/index.js +1258 -10
  60. package/dist/expression/indicator-functions.d.ts +14 -0
  61. package/dist/expression/indicator-functions.js +208 -21
  62. package/dist/expression/type.d.ts +70 -0
  63. package/dist/expression/type.js +1 -5
  64. package/dist/filesystem.d.ts +143 -0
  65. package/dist/filesystem.js +286 -324
  66. package/dist/function.d.ts +20 -0
  67. package/dist/function.js +90 -51
  68. package/dist/index.d.ts +23 -0
  69. package/dist/index.js +3064 -26
  70. package/dist/indicators.d.ts +68 -0
  71. package/dist/indicators.js +418 -79
  72. package/dist/module.d.ts +10 -0
  73. package/dist/module.js +154 -109
  74. package/dist/number.d.ts +35 -0
  75. package/dist/number.js +397 -25
  76. package/dist/object.d.ts +231 -0
  77. package/dist/object.js +854 -803
  78. package/dist/process.d.ts +22 -0
  79. package/dist/process.js +200 -38
  80. package/dist/property-types.d.ts +460 -0
  81. package/dist/property-types.js +17 -96
  82. package/dist/scope.d.ts +44 -0
  83. package/dist/scope.js +1987 -56
  84. package/dist/string.d.ts +319 -0
  85. package/dist/string.js +929 -626
  86. package/dist/test/Lock.d.ts +1 -0
  87. package/dist/test/Logger.d.ts +1 -0
  88. package/dist/test/Semaphore.d.ts +1 -0
  89. package/dist/test/array.d.ts +1 -0
  90. package/dist/test/cookie.d.ts +1 -0
  91. package/dist/test/data-transfer.d.ts +1 -0
  92. package/dist/test/datetime.d.ts +1 -0
  93. package/dist/test/domNode.d.ts +1 -0
  94. package/dist/test/expression/evaluators.d.ts +1 -0
  95. package/dist/test/expression/helper.d.ts +1 -0
  96. package/dist/test/expression/indicator-functions.d.ts +1 -0
  97. package/dist/test/filesystem.d.ts +1 -0
  98. package/dist/test/function.d.ts +1 -0
  99. package/dist/test/indicators.d.ts +1 -0
  100. package/dist/test/number.d.ts +1 -0
  101. package/dist/test/object.d.ts +1 -0
  102. package/dist/test/process.d.ts +1 -0
  103. package/dist/test/property-types.d.ts +1 -0
  104. package/dist/test/scope.d.ts +1 -0
  105. package/dist/test/string.d.ts +1 -0
  106. package/dist/test/utility.d.ts +1 -0
  107. package/dist/test-helper.d.ts +245 -0
  108. package/dist/test-helper.js +514 -289
  109. package/dist/type.d.ts +248 -0
  110. package/dist/type.js +4 -9
  111. package/dist/utility.d.ts +44 -0
  112. package/dist/utility.js +310 -91
  113. package/package.json +2 -2
@@ -0,0 +1,22 @@
1
+ import type { ChildProcess } from 'child_process';
2
+ import type { AnyFunction, ProcessCloseCallback, ProcessErrorCallback, ProcessHandler } from './type';
3
+ /**
4
+ * Generates a one shot close handler which triggers given promise methods.
5
+ * If a reason is provided it will be given as resolve target. An Error will be
6
+ * generated if return code is not zero. The generated Error has a property
7
+ * "returnCode" which provides corresponding process return code.
8
+ * @param resolve - Promise's resolve function.
9
+ * @param reject - Promise's reject function.
10
+ * @param reason - Promise target if process has a zero return code.
11
+ * @param callback - Optional function to call of process has successfully
12
+ * finished.
13
+ * @returns Process close handler function.
14
+ */
15
+ export declare const getProcessCloseHandler: (resolve: ProcessCloseCallback, reject: ProcessErrorCallback, reason?: unknown, callback?: AnyFunction) => ProcessHandler;
16
+ /**
17
+ * Forwards given child process communication channels to corresponding current
18
+ * process communication channels.
19
+ * @param childProcess - Child process meta data.
20
+ * @returns Given child process meta data.
21
+ */
22
+ export declare const handleChildProcess: (childProcess: ChildProcess) => ChildProcess;
package/dist/process.js CHANGED
@@ -1,9 +1,49 @@
1
+ if(typeof window==='undefined'||window===null)var window=(typeof globalThis==='undefined'||globalThis===null)?{}:globalThis;/******/ var __webpack_modules__ = ({
2
+
3
+ /***/ 5:
4
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5
+
6
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7
+ /* harmony export */ tE: function() { return /* binding */ NOOP; }
8
+ /* harmony export */ });
9
+ /* unused harmony exports globalContext, setGlobalContext, MAXIMAL_NUMBER_OF_ITERATIONS, mockConsole */
10
+ /* unused harmony import specifier */ var CONSOLE_METHODS;
11
+ /* harmony import */ var _module_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
1
12
  // #!/usr/bin/env babel-node
2
13
  // -*- coding: utf-8 -*-
3
- /** @module process */
4
- 'use strict';
14
+ /** @module context *//* !
15
+ region header
16
+ [Project page](https://torben.website/clientnode)
17
+
18
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
19
+
20
+ License
21
+ -------
22
+
23
+ This library written by Torben Sickert stands under a creative commons
24
+ naming 3.0 unported license.
25
+ See https://creativecommons.org/licenses/by/3.0/deed.de
26
+ endregion
27
+ */var _optionalRequire$defa,_optionalRequire;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n};var globalContext=(0,_module_js__WEBPACK_IMPORTED_MODULE_0__/* .determineGlobalContext */ .a8)();var setGlobalContext=function setGlobalContext(context){globalContext=context};globalContext.fetch=globalContext.fetch?globalContext.fetch.bind(globalContext):(_optionalRequire$defa=(_optionalRequire=(0,_module_js__WEBPACK_IMPORTED_MODULE_0__/* .optionalRequire */ .I5)("node-fetch"))===null||_optionalRequire===void 0?void 0:_optionalRequire.default)!==null&&_optionalRequire$defa!==void 0?_optionalRequire$defa:function(){for(var _len=arguments.length,parameters=new Array(_len),_key=0;_key<_len;_key++){parameters[_key]=arguments[_key]}return (0,_module_js__WEBPACK_IMPORTED_MODULE_0__/* .optionalImport */ .Sw)(/* webpackIgnore: true */"node-fetch").then(function(module){var _ref;return(_ref=module).default.apply(_ref,parameters)})};var MAXIMAL_NUMBER_OF_ITERATIONS=(/* unused pure expression or super */ null && ({value:100}));// A no-op dummy function.
28
+ var NOOP=function NOOP(){// Do nothing.
29
+ };var mockConsole=function mockConsole(){// Avoid errors in browsers that lack a console.
30
+ 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()}};
31
+
32
+ /***/ }),
5
33
 
6
- /* !
34
+ /***/ 2:
35
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
36
+
37
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38
+ /* harmony export */ I5: function() { return /* binding */ optionalRequire; },
39
+ /* harmony export */ Sw: function() { return /* binding */ optionalImport; },
40
+ /* harmony export */ a8: function() { return /* binding */ determineGlobalContext; }
41
+ /* harmony export */ });
42
+ /* unused harmony exports isImportSyntaxSupported, currentRequire, setOptionalRequire, getCurrentRequire, clearRequireCache, isolatedRequire */
43
+ /* module decorator */ module = __webpack_require__.hmd(module);
44
+ // #!/usr/bin/env babel-node
45
+ // -*- coding: utf-8 -*-
46
+ /** @module module *//* !
7
47
  region header
8
48
  [Project page](https://torben.website/clientnode)
9
49
 
@@ -16,10 +56,42 @@
16
56
  naming 3.0 unported license.
17
57
  See https://creativecommons.org/licenses/by/3.0/deed.de
18
58
  endregion
19
- */
20
- import { NOOP } from "./context.js";
59
+ */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}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)})}}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();var isImportSyntaxSupported=function isImportSyntaxSupported(){try{// eslint-disable-next-line @typescript-eslint/no-implied-eval
60
+ new Function("import(\"data:text/javascript,\")");return true}catch(_unused){return false}};var currentRequire=typeof globalContext.require==="undefined"?null:globalContext.require;var optionalRequire;var setOptionalRequire=function setOptionalRequire(localCurrentRequire){optionalRequire=function optionalRequire(id){try{return localCurrentRequire?localCurrentRequire(id):null}catch(_unused2){return null}}};setOptionalRequire(currentRequire);// Make preprocessed require function available at runtime.
61
+ var getCurrentRequire=/*#__PURE__*/(/* unused pure expression or super */ null && (function(){var _getCurrentRequire=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(){var _yield$Function,createRequire,_t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:if(!currentRequire){_context.n=1;break}return _context.a(2,currentRequire);case 1:_context.p=1;_context.n=2;return new Function("return import(\"node:module\")")();case 2:_yield$Function=_context.v;createRequire=_yield$Function.createRequire;/*
62
+ eslint-enable
63
+ @typescript-eslint/no-implied-eval,
64
+ @typescript-eslint/no-unsafe-call
65
+ */// eslint-disable-next-line @typescript-eslint/no-unsafe-call
66
+ currentRequire=createRequire("file:///__w/clientnode/clientnode/src/module.ts");setOptionalRequire(currentRequire);return _context.a(2,currentRequire);case 3:_context.p=3;_t=_context.v;console.error(_t);return _context.a(2,null)}},_callee,null,[[1,3]])}));function getCurrentRequire(){return _getCurrentRequire.apply(this,arguments)}return getCurrentRequire}()));var clearRequireCache=function clearRequireCache(cache){if(cache===void 0){var _currentRequire;cache=((_currentRequire=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){var _currentRequire2;cache=((_currentRequire2=currentRequire)===null||_currentRequire2===void 0?void 0:_currentRequire2.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
67
+ }catch(error){throw error}finally{restoreRequireCache(requireFunction.cache,backup)}};var optionalImport=/*#__PURE__*/function(){var _optionalImport=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(id,options){var _t2,_t3;return _regenerator().w(function(_context2){while(1)switch(_context2.p=_context2.n){case 0:if(options===void 0){options={}}_context2.p=1;if(!isImportSyntaxSupported()){_context2.n=3;break}_context2.n=2;return new Function("options","return import('".concat(id,"', options)"))(options);case 2:_t2=_context2.v;_context2.n=5;break;case 3:_context2.n=4;return Promise.resolve(null);case 4:_t2=_context2.v;case 5:return _context2.a(2,_t2);case 6:_context2.p=6;_t3=_context2.v;_context2.n=7;return Promise.resolve(null);case 7:return _context2.a(2,_context2.v)}},_callee2,null,[[1,6]])}));function optionalImport(_x,_x2){return _optionalImport.apply(this,arguments)}return optionalImport}();
68
+
69
+ /***/ }),
70
+
71
+ /***/ 26:
72
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
21
73
 
22
- /**
74
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
75
+ /* harmony export */ G: function() { return /* binding */ handleChildProcess; },
76
+ /* harmony export */ q: function() { return /* binding */ getProcessCloseHandler; }
77
+ /* harmony export */ });
78
+ /* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
79
+ // #!/usr/bin/env babel-node
80
+ // -*- coding: utf-8 -*-
81
+ /** @module process *//* !
82
+ region header
83
+ [Project page](https://torben.website/clientnode)
84
+
85
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
86
+
87
+ License
88
+ -------
89
+
90
+ This library written by Torben Sickert stands under a creative commons
91
+ naming 3.0 unported license.
92
+ See https://creativecommons.org/licenses/by/3.0/deed.de
93
+ endregion
94
+ *//**
23
95
  * Generates a one shot close handler which triggers given promise methods.
24
96
  * If a reason is provided it will be given as resolve target. An Error will be
25
97
  * generated if return code is not zero. The generated Error has a property
@@ -30,39 +102,129 @@ import { NOOP } from "./context.js";
30
102
  * @param callback - Optional function to call of process has successfully
31
103
  * finished.
32
104
  * @returns Process close handler function.
33
- */
34
- export const getProcessCloseHandler = (resolve, reject, reason = null, callback = NOOP) => {
35
- let finished = false;
36
- return (returnCode, ...parameters) => {
37
- if (finished) finished = true;else {
38
- finished = true;
39
- if (typeof returnCode !== 'number' || returnCode === 0) {
40
- callback();
41
- resolve({
42
- reason,
43
- parameters
44
- });
45
- } else {
46
- const error = new Error(`Task exited with error code ${String(returnCode)}`);
47
- error.returnCode = returnCode;
48
- error.parameters = parameters;
49
- reject(error);
50
- }
51
- }
52
- };
53
- };
54
- /**
105
+ */var getProcessCloseHandler=function getProcessCloseHandler(resolve,reject,reason,callback){if(reason===void 0){reason=null}if(callback===void 0){callback=_context_js__WEBPACK_IMPORTED_MODULE_0__/* .NOOP */ .tE}var finished=false;return function(returnCode){if(finished)finished=true;else{finished=true;for(var _len=arguments.length,parameters=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){parameters[_key-1]=arguments[_key]}if(typeof returnCode!=="number"||returnCode===0){callback();resolve({reason:reason,parameters:parameters})}else{var error=new Error("Task exited with error code ".concat(String(returnCode)));error.returnCode=returnCode;error.parameters=parameters;reject(error)}}}};/**
55
106
  * Forwards given child process communication channels to corresponding current
56
107
  * process communication channels.
57
108
  * @param childProcess - Child process meta data.
58
109
  * @returns Given child process meta data.
59
- */
60
- export const handleChildProcess = childProcess => {
61
- if (childProcess.stdout) childProcess.stdout.pipe(process.stdout);
62
- if (childProcess.stderr) childProcess.stderr.pipe(process.stderr);
63
- childProcess.on('close', returnCode => {
64
- if (returnCode !== 0) console.error(`Task exited with error code ${String(returnCode)}`);
65
- });
66
- return childProcess;
67
- };
68
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL3Byb2Nlc3MudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gIyEvdXNyL2Jpbi9lbnYgYmFiZWwtbm9kZVxuLy8gLSotIGNvZGluZzogdXRmLTggLSotXG4vKiogQG1vZHVsZSBwcm9jZXNzICovXG4ndXNlIHN0cmljdCdcbi8qICFcbiAgICByZWdpb24gaGVhZGVyXG4gICAgW1Byb2plY3QgcGFnZV0oaHR0cHM6Ly90b3JiZW4ud2Vic2l0ZS9jbGllbnRub2RlKVxuXG4gICAgQ29weXJpZ2h0IFRvcmJlbiBTaWNrZXJ0IChpbmZvW1wifmF0flwiXXRvcmJlbi53ZWJzaXRlKSAxNi4xMi4yMDEyXG5cbiAgICBMaWNlbnNlXG4gICAgLS0tLS0tLVxuXG4gICAgVGhpcyBsaWJyYXJ5IHdyaXR0ZW4gYnkgVG9yYmVuIFNpY2tlcnQgc3RhbmRzIHVuZGVyIGEgY3JlYXRpdmUgY29tbW9uc1xuICAgIG5hbWluZyAzLjAgdW5wb3J0ZWQgbGljZW5zZS5cbiAgICBTZWUgaHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LzMuMC9kZWVkLmRlXG4gICAgZW5kcmVnaW9uXG4qL1xuaW1wb3J0IHR5cGUge0NoaWxkUHJvY2Vzc30gZnJvbSAnY2hpbGRfcHJvY2VzcydcbmltcG9ydCB0eXBlIHtcbiAgICBBbnlGdW5jdGlvbixcbiAgICBQcm9jZXNzQ2xvc2VDYWxsYmFjayxcbiAgICBQc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0Nsb3NlQ2FsbGJhY2ssXG4gICAgcmVqZWN0OiBQcm9jZXNzRXJyb3JDYWxsYmFjayxcbiAgICByZWFzb246IHVua25vd24gPSBudWxsLFxuICAgIGNhbGxiYWNrOiBBbnlGdW5jdGlvbiA9IE5PT1Bcbik6IFByb2Nlc3NIYW5kbGVyID0+IHtcbiAgICBsZXQgZmluaXNoZWQgPSBmYWxzZVxuXG4gICAgcmV0dXJuIChyZXR1cm5Db2RlOiB1bmtub3duLCAuLi5wYXJhbWV0ZXJzOiBBcnJheTx1bmtub3duPik6IHZvaWQgPT4ge1xuICAgICAgICBpZiAoZmluaXNoZWQpXG4gICAgICAgICAgICBmaW5pc2hlZCA9IHRydWVcbiAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICBmaW5pc2hlZCA9IHRydWVcbiAgICAgICAgICAgIGlmICh0eXBlb2YgcmV0dXJuQ29kZSAhPT0gJ251bWJlcicgfHwgcmV0dXJuQ29kZSA9PT0gMCkge1xuICAgICAgICAgICAgICAgIGNhbGxiYWNrKClcbiAgICAgICAgICAgICAgICByZXNvbHZlKHtyZWFzb24sIHBhcmFtZXRlcnN9KVxuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBjb25zdCBlcnJvciA9IG5ldyBFcnJvcihcbiAgICAgICAgICAgICAgICAgICAgYFRhc2sgZXhpdGVkIHdpdGggZXJyb3IgY29kZSAke1N0cmluZyhyZXR1cm5Db2RlKX1gXG4gICAgICAgICAgICAgICAgKSBhcyBQcm9jZXNzRXJyb3JcblxuICAgICAgICAgICAgICAgIGVycm9yLnJldHVybkNvZGUgPSByZXR1cm5Db2RlXG4gICAgICAgICAgICAgICAgZXJyb3IucGFyYW1ldGVycyA9IHBhcmFtZXRlcnNcblxuICAgICAgICAgICAgICAgIHJlamVjdChlcnJvcilcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbi8qKlxuICogRm9yd2FyZHMgZ2l2ZW4gY2hpbGQgcHJ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xFQUNuQixZQUFZLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxDQUFDO0VBRTVDLFlBQVksQ0FBQyxFQUFFLENBQUMsT0FBTyxFQUFHLFVBQWtCLElBQVc7SUFDbkQsSUFBSSxVQUFVLEtBQUssQ0FBQyxFQUNoQixPQUFPLENBQUMsS0FBSyxDQUFDLCtCQUErQixNQUFNLENBQUMsVUFBVSxDQUFDLEVBQUUsQ0FBQztFQUMxRSxDQUFDLENBQUM7RUFFRixPQUFPLFlBQVk7QUFDdkIsQ0FBQyIsImlnbm9yZUxpc3QiOltdfQ==
110
+ */var handleChildProcess=function handleChildProcess(childProcess){if(childProcess.stdout)childProcess.stdout.pipe(process.stdout);if(childProcess.stderr)childProcess.stderr.pipe(process.stderr);childProcess.on("close",function(returnCode){if(returnCode!==0)console.error("Task exited with error code ".concat(String(returnCode)))});return childProcess};
111
+
112
+ /***/ }),
113
+
114
+ /***/ 6:
115
+ /***/ (function(module) {
116
+
117
+ function webpackEmptyContext(req) {
118
+ var e = new Error("Cannot find module '" + req + "'");
119
+ e.code = 'MODULE_NOT_FOUND';
120
+ throw e;
121
+ }
122
+ webpackEmptyContext.keys = function() { return []; };
123
+ webpackEmptyContext.resolve = webpackEmptyContext;
124
+ webpackEmptyContext.id = 6;
125
+ module.exports = webpackEmptyContext;
126
+
127
+ /***/ })
128
+
129
+ /******/ });
130
+ /************************************************************************/
131
+ /******/ // The module cache
132
+ /******/ var __webpack_module_cache__ = {};
133
+ /******/
134
+ /******/ // The require function
135
+ /******/ function __webpack_require__(moduleId) {
136
+ /******/ // Check if module is in cache
137
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
138
+ /******/ if (cachedModule !== undefined) {
139
+ /******/ return cachedModule.exports;
140
+ /******/ }
141
+ /******/ // Create a new module (and put it into the cache)
142
+ /******/ var module = __webpack_module_cache__[moduleId] = {
143
+ /******/ id: moduleId,
144
+ /******/ loaded: false,
145
+ /******/ exports: {}
146
+ /******/ };
147
+ /******/
148
+ /******/ // Execute the module function
149
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
150
+ /******/
151
+ /******/ // Flag the module as loaded
152
+ /******/ module.loaded = true;
153
+ /******/
154
+ /******/ // Return the exports of the module
155
+ /******/ return module.exports;
156
+ /******/ }
157
+ /******/
158
+ /******/ // expose the module cache
159
+ /******/ __webpack_require__.c = __webpack_module_cache__;
160
+ /******/
161
+ /************************************************************************/
162
+ /******/ /* webpack/runtime/define property getters */
163
+ /******/ !function() {
164
+ /******/ // define getter/value functions for harmony exports
165
+ /******/ __webpack_require__.d = function(exports, definition) {
166
+ /******/ if(Array.isArray(definition)) {
167
+ /******/ var i = 0;
168
+ /******/ while(i < definition.length) {
169
+ /******/ var key = definition[i++];
170
+ /******/ var binding = definition[i++];
171
+ /******/ if(!__webpack_require__.o(exports, key)) {
172
+ /******/ if(binding === 0) {
173
+ /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
174
+ /******/ } else {
175
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
176
+ /******/ }
177
+ /******/ } else if(binding === 0) { i++; }
178
+ /******/ }
179
+ /******/ } else {
180
+ /******/ for(var key in definition) {
181
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
182
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
183
+ /******/ }
184
+ /******/ }
185
+ /******/ }
186
+ /******/ };
187
+ /******/ }();
188
+ /******/
189
+ /******/ /* webpack/runtime/global */
190
+ /******/ !function() {
191
+ /******/ __webpack_require__.g = (function() {
192
+ /******/ if (typeof globalThis === 'object') return globalThis;
193
+ /******/ try {
194
+ /******/ return this || new Function('return this')();
195
+ /******/ } catch (e) {
196
+ /******/ if (typeof window === 'object') return window;
197
+ /******/ }
198
+ /******/ })();
199
+ /******/ }();
200
+ /******/
201
+ /******/ /* webpack/runtime/harmony module decorator */
202
+ /******/ !function() {
203
+ /******/ __webpack_require__.hmd = function(module) {
204
+ /******/ module = Object.create(module);
205
+ /******/ if (!module.children) module.children = [];
206
+ /******/ Object.defineProperty(module, 'exports', {
207
+ /******/ enumerable: true,
208
+ /******/ set: function() {
209
+ /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
210
+ /******/ }
211
+ /******/ });
212
+ /******/ return module;
213
+ /******/ };
214
+ /******/ }();
215
+ /******/
216
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
217
+ /******/ !function() {
218
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
219
+ /******/ }();
220
+ /******/
221
+ /************************************************************************/
222
+ /******/
223
+ /******/ // module cache are used so entry inlining is disabled
224
+ /******/ // startup
225
+ /******/ // Load entry module and return exports
226
+ /******/ var __webpack_exports__ = __webpack_require__(26);
227
+ /******/ var __webpack_exports__getProcessCloseHandler = __webpack_exports__.q;
228
+ /******/ var __webpack_exports__handleChildProcess = __webpack_exports__.G;
229
+ /******/ export { __webpack_exports__getProcessCloseHandler as getProcessCloseHandler, __webpack_exports__handleChildProcess as handleChildProcess };
230
+ /******/