clientnode 4.0.1491 → 4.0.1492

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.js +83 -68
  2. package/dist/Logger.js +163 -693
  3. package/dist/Semaphore.js +46 -55
  4. package/dist/array.js +337 -545
  5. package/dist/cli.js +37 -44
  6. package/dist/constants.js +110 -184
  7. package/dist/context.js +25 -209
  8. package/dist/cookie.js +48 -204
  9. package/dist/data-transfer.js +166 -701
  10. package/dist/datetime.js +245 -1042
  11. package/dist/domNode.js +277 -427
  12. package/dist/expression/evaluators.js +234 -1108
  13. package/dist/expression/helper.js +82 -100
  14. package/dist/expression/index.js +10 -1253
  15. package/dist/expression/indicator-functions.js +21 -208
  16. package/dist/expression/type.js +5 -1
  17. package/dist/filesystem.js +324 -286
  18. package/dist/function.js +51 -90
  19. package/dist/index.js +26 -3059
  20. package/dist/indicators.js +79 -418
  21. package/dist/module.js +109 -154
  22. package/dist/number.js +25 -397
  23. package/dist/object.js +803 -849
  24. package/dist/process.js +38 -200
  25. package/dist/property-types.js +96 -17
  26. package/dist/scope.js +56 -1982
  27. package/dist/string.js +626 -924
  28. package/dist/test-helper.js +289 -514
  29. package/dist/type.js +9 -4
  30. package/dist/utility.js +91 -310
  31. package/package.json +2 -2
  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/index.js +0 -4507
  37. package/dist/cli.d.ts +0 -31
  38. package/dist/compatible/Lock.js +0 -85
  39. package/dist/compatible/Logger.js +0 -715
  40. package/dist/compatible/Semaphore.js +0 -74
  41. package/dist/compatible/array.js +0 -660
  42. package/dist/compatible/cli.js +0 -58
  43. package/dist/compatible/constants.js +0 -200
  44. package/dist/compatible/context.js +0 -224
  45. package/dist/compatible/cookie.js +0 -240
  46. package/dist/compatible/data-transfer.js +0 -751
  47. package/dist/compatible/datetime.js +0 -1083
  48. package/dist/compatible/domNode.js +0 -481
  49. package/dist/compatible/expression/evaluators.js +0 -1147
  50. package/dist/compatible/expression/helper.js +0 -115
  51. package/dist/compatible/expression/index.js +0 -1269
  52. package/dist/compatible/expression/indicator-functions.js +0 -224
  53. package/dist/compatible/expression/type.js +0 -16
  54. package/dist/compatible/filesystem.js +0 -373
  55. package/dist/compatible/function.js +0 -114
  56. package/dist/compatible/index.js +0 -3076
  57. package/dist/compatible/indicators.js +0 -471
  58. package/dist/compatible/module.js +0 -168
  59. package/dist/compatible/number.js +0 -433
  60. package/dist/compatible/object.js +0 -1037
  61. package/dist/compatible/process.js +0 -230
  62. package/dist/compatible/property-types.js +0 -36
  63. package/dist/compatible/scope.js +0 -2011
  64. package/dist/compatible/string.js +0 -1151
  65. package/dist/compatible/test-helper.js +0 -837
  66. package/dist/compatible/type.js +0 -16
  67. package/dist/compatible/utility.js +0 -358
  68. package/dist/constants.d.ts +0 -99
  69. package/dist/context.d.ts +0 -8
  70. package/dist/cookie.d.ts +0 -31
  71. package/dist/data-transfer.d.ts +0 -45
  72. package/dist/datetime.d.ts +0 -37
  73. package/dist/domNode.d.ts +0 -82
  74. package/dist/expression/evaluators.d.ts +0 -55
  75. package/dist/expression/helper.d.ts +0 -4
  76. package/dist/expression/index.d.ts +0 -7
  77. package/dist/expression/indicator-functions.d.ts +0 -14
  78. package/dist/expression/type.d.ts +0 -70
  79. package/dist/filesystem.d.ts +0 -143
  80. package/dist/function.d.ts +0 -20
  81. package/dist/index.d.ts +0 -23
  82. package/dist/indicators.d.ts +0 -68
  83. package/dist/module.d.ts +0 -10
  84. package/dist/number.d.ts +0 -35
  85. package/dist/object.d.ts +0 -231
  86. package/dist/process.d.ts +0 -22
  87. package/dist/property-types.d.ts +0 -460
  88. package/dist/scope.d.ts +0 -44
  89. package/dist/string.d.ts +0 -319
  90. package/dist/test/Lock.d.ts +0 -1
  91. package/dist/test/Logger.d.ts +0 -1
  92. package/dist/test/Semaphore.d.ts +0 -1
  93. package/dist/test/array.d.ts +0 -1
  94. package/dist/test/cookie.d.ts +0 -1
  95. package/dist/test/data-transfer.d.ts +0 -1
  96. package/dist/test/datetime.d.ts +0 -1
  97. package/dist/test/domNode.d.ts +0 -1
  98. package/dist/test/expression/evaluators.d.ts +0 -1
  99. package/dist/test/expression/helper.d.ts +0 -1
  100. package/dist/test/expression/indicator-functions.d.ts +0 -1
  101. package/dist/test/filesystem.d.ts +0 -1
  102. package/dist/test/function.d.ts +0 -1
  103. package/dist/test/indicators.d.ts +0 -1
  104. package/dist/test/number.d.ts +0 -1
  105. package/dist/test/object.d.ts +0 -1
  106. package/dist/test/process.d.ts +0 -1
  107. package/dist/test/property-types.d.ts +0 -1
  108. package/dist/test/scope.d.ts +0 -1
  109. package/dist/test/string.d.ts +0 -1
  110. package/dist/test/utility.d.ts +0 -1
  111. package/dist/test-helper.d.ts +0 -245
  112. package/dist/type.d.ts +0 -248
  113. package/dist/utility.d.ts +0 -44
package/dist/context.js CHANGED
@@ -1,50 +1,9 @@
1
- if(typeof window==='undefined'||window===null)var window=(typeof globalThis==='undefined'||globalThis===null)?{}:globalThis;/******/ var __webpack_modules__ = ([
2
- /* 0 */,
3
- /* 1 */
4
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
5
-
6
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7
- /* harmony export */ jg: function() { return /* binding */ CONSOLE_METHODS; }
8
- /* harmony export */ });
9
- /* unused harmony exports DEFAULT_ENCODING, CLOSE_EVENT_NAMES, VALUE_COPY_SYMBOL, IGNORE_NULL_AND_UNDEFINED_SYMBOL, ABBREVIATIONS, ANIMATION_END_EVENT_NAMES, CLASS_TO_TYPE_MAPPING, KEY_CODES, KEYBOARD_CODES, LOCALES, PLAIN_OBJECT_PROTOTYPES, SPECIAL_REGEX_SEQUENCES, TRANSITION_END_EVENT_NAMES */
10
1
  // #!/usr/bin/env babel-node
11
2
  // -*- coding: utf-8 -*-
12
- /** @module constants *//* !
13
- region header
14
- [Project page](https://torben.website/clientnode)
15
-
16
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
17
-
18
- License
19
- -------
20
-
21
- This library written by Torben Sickert stands under a creative commons
22
- naming 3.0 unported license.
23
- See https://creativecommons.org/licenses/by/3.0/deed.de
24
- endregion
25
- */var DEFAULT_ENCODING="utf8";var CLOSE_EVENT_NAMES=(/* unused pure expression or super */ null && (["close","exit","SIGINT","SIGTERM","SIGQUIT","uncaughtException"]));var CONSOLE_METHODS=["debug","error","info","log","warn"];var VALUE_COPY_SYMBOL=Symbol.for("clientnodeValue");var IGNORE_NULL_AND_UNDEFINED_SYMBOL=Symbol.for("clientnodeIgnoreNullAndUndefined");// Lists all known abbreviation for proper camel case to delimited and back
26
- // conversion.
27
- var ABBREVIATIONS=(/* unused pure expression or super */ null && (["html","id","url","us","de","api","href"]));// Saves a string with all css3 browser specific animation end event names.
28
- var ANIMATION_END_EVENT_NAMES="animationend webkitAnimationEnd oAnimationEnd MSAnimationEnd";// String representation to object type name mapping.
29
- var CLASS_TO_TYPE_MAPPING=(/* unused pure expression or super */ null && ({"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Error]":"error","[object Function]":"function","[object Map]":"map","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object Set]":"set","[object String]":"string"}));// Saves a mapping from key codes to their corresponding name.
30
- var KEY_CODES=(/* unused pure expression or super */ null && ({BACKSPACE:8,SPACE:32,TAB:9,DELETE:46,ENTER:13,COMMA:188,PERIOD:190,END:35,ESCAPE:27,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,HOME:36,NUMPAD_ADD:107,NUMPAD_SUBTRACT:109,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,PAGE_UP:33,PAGE_DOWN:34,UP:38,DOWN:40,LEFT:37,RIGHT:39}));var KEYBOARD_CODES=(/* unused pure expression or super */ null && ({BACKSPACE:"Backspace",SPACE:"Space",TAB:"Tab",DELETE:"Delete",ENTER:"Enter",COMMA:"Comma",PERIOD:"Period",END:"End",ESCAPE:"Escape",F1:"F1",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",F10:"F10",F11:"F111",F12:"F12",HOME:"Home",NUMPAD_ADD:"NumpadAdd",NUMPAD_SUBTRACT:"NumpadSubtract",NUMPAD_DECIMAL:"NumpadDecimal",NUMPAD_DIVIDE:"NumpadDivide",NUMPAD_ENTER:"NumpadEnter",NUMPAD_MULTIPLY:"NumpadMultiply",PAGE_UP:"PageUp",PAGE_DOWN:"PageUp",UP:"ArrowUp",DOWN:"ArrowDown",LEFT:"ArrowLeft",RIGHT:"ArrowUp"}));var LOCALES=(/* unused pure expression or super */ null && ([]));var PLAIN_OBJECT_PROTOTYPES=[Object.prototype];// A list of special regular expression symbols.
31
- var SPECIAL_REGEX_SEQUENCES=(/* unused pure expression or super */ null && (["-","[","]","(",")","^","$","*","+",".","{","}"]));// Saves a string with all css3 browser specific transition end event names.
32
- var TRANSITION_END_EVENT_NAMES="transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd";
33
-
34
- /***/ }),
35
- /* 2 */
36
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
3
+ /** @module context */
4
+ 'use strict';
37
5
 
38
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
39
- /* harmony export */ I5: function() { return /* binding */ optionalRequire; },
40
- /* harmony export */ Sw: function() { return /* binding */ optionalImport; },
41
- /* harmony export */ a8: function() { return /* binding */ determineGlobalContext; }
42
- /* harmony export */ });
43
- /* unused harmony exports isImportSyntaxSupported, currentRequire, setOptionalRequire, getCurrentRequire, clearRequireCache, isolatedRequire */
44
- /* module decorator */ module = __webpack_require__.hmd(module);
45
- // #!/usr/bin/env babel-node
46
- // -*- coding: utf-8 -*-
47
- /** @module module *//* !
6
+ /* !
48
7
  region header
49
8
  [Project page](https://torben.website/clientnode)
50
9
 
@@ -57,168 +16,25 @@ var TRANSITION_END_EVENT_NAMES="transitionend webkitTransitionEnd oTransitionEnd
57
16
  naming 3.0 unported license.
58
17
  See https://creativecommons.org/licenses/by/3.0/deed.de
59
18
  endregion
60
- */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
61
- 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.
62
- 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;/*
63
- eslint-enable
64
- @typescript-eslint/no-implied-eval,
65
- @typescript-eslint/no-unsafe-call
66
- */// eslint-disable-next-line @typescript-eslint/no-unsafe-call
67
- 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
68
- }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}();
69
-
70
- /***/ }),
71
- /* 3 */,
72
- /* 4 */,
73
- /* 5 */
74
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
75
-
76
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
77
- /* harmony export */ $Q: function() { return /* binding */ MAXIMAL_NUMBER_OF_ITERATIONS; },
78
- /* harmony export */ Lz: function() { return /* binding */ globalContext; },
79
- /* harmony export */ QH: function() { return /* binding */ mockConsole; },
80
- /* harmony export */ tE: function() { return /* binding */ NOOP; },
81
- /* harmony export */ zm: function() { return /* binding */ setGlobalContext; }
82
- /* harmony export */ });
83
- /* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
84
- /* harmony import */ var _module_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
85
- // #!/usr/bin/env babel-node
86
- // -*- coding: utf-8 -*-
87
- /** @module context *//* !
88
- region header
89
- [Project page](https://torben.website/clientnode)
90
-
91
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
92
-
93
- License
94
- -------
95
-
96
- This library written by Torben Sickert stands under a creative commons
97
- naming 3.0 unported license.
98
- See https://creativecommons.org/licenses/by/3.0/deed.de
99
- endregion
100
- */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={value:100};// A no-op dummy function.
101
- var NOOP=function NOOP(){// Do nothing.
102
- };var mockConsole=function mockConsole(){// Avoid errors in browsers that lack a console.
103
- if(!Object.prototype.hasOwnProperty.call(globalContext,"console"))globalContext.console={};if(!globalContext.console)globalContext.console={};var _iterator=_createForOfIteratorHelper(_constants_js__WEBPACK_IMPORTED_MODULE_1__/* .CONSOLE_METHODS */ .jg),_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()}};
104
-
105
- /***/ }),
106
- /* 6 */
107
- /***/ (function(module) {
108
-
109
- function webpackEmptyContext(req) {
110
- var e = new Error("Cannot find module '" + req + "'");
111
- e.code = 'MODULE_NOT_FOUND';
112
- throw e;
113
- }
114
- webpackEmptyContext.keys = function() { return []; };
115
- webpackEmptyContext.resolve = webpackEmptyContext;
116
- webpackEmptyContext.id = 6;
117
- module.exports = webpackEmptyContext;
118
-
119
- /***/ })
120
- /******/ ]);
121
- /************************************************************************/
122
- /******/ // The module cache
123
- /******/ var __webpack_module_cache__ = {};
124
- /******/
125
- /******/ // The require function
126
- /******/ function __webpack_require__(moduleId) {
127
- /******/ // Check if module is in cache
128
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
129
- /******/ if (cachedModule !== undefined) {
130
- /******/ return cachedModule.exports;
131
- /******/ }
132
- /******/ // Create a new module (and put it into the cache)
133
- /******/ var module = __webpack_module_cache__[moduleId] = {
134
- /******/ id: moduleId,
135
- /******/ loaded: false,
136
- /******/ exports: {}
137
- /******/ };
138
- /******/
139
- /******/ // Execute the module function
140
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
141
- /******/
142
- /******/ // Flag the module as loaded
143
- /******/ module.loaded = true;
144
- /******/
145
- /******/ // Return the exports of the module
146
- /******/ return module.exports;
147
- /******/ }
148
- /******/
149
- /******/ // expose the module cache
150
- /******/ __webpack_require__.c = __webpack_module_cache__;
151
- /******/
152
- /************************************************************************/
153
- /******/ /* webpack/runtime/define property getters */
154
- /******/ !function() {
155
- /******/ // define getter/value functions for harmony exports
156
- /******/ __webpack_require__.d = function(exports, definition) {
157
- /******/ if(Array.isArray(definition)) {
158
- /******/ var i = 0;
159
- /******/ while(i < definition.length) {
160
- /******/ var key = definition[i++];
161
- /******/ var binding = definition[i++];
162
- /******/ if(!__webpack_require__.o(exports, key)) {
163
- /******/ if(binding === 0) {
164
- /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
165
- /******/ } else {
166
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
167
- /******/ }
168
- /******/ } else if(binding === 0) { i++; }
169
- /******/ }
170
- /******/ } else {
171
- /******/ for(var key in definition) {
172
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
173
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
174
- /******/ }
175
- /******/ }
176
- /******/ }
177
- /******/ };
178
- /******/ }();
179
- /******/
180
- /******/ /* webpack/runtime/global */
181
- /******/ !function() {
182
- /******/ __webpack_require__.g = (function() {
183
- /******/ if (typeof globalThis === 'object') return globalThis;
184
- /******/ try {
185
- /******/ return this || new Function('return this')();
186
- /******/ } catch (e) {
187
- /******/ if (typeof window === 'object') return window;
188
- /******/ }
189
- /******/ })();
190
- /******/ }();
191
- /******/
192
- /******/ /* webpack/runtime/harmony module decorator */
193
- /******/ !function() {
194
- /******/ __webpack_require__.hmd = function(module) {
195
- /******/ module = Object.create(module);
196
- /******/ if (!module.children) module.children = [];
197
- /******/ Object.defineProperty(module, 'exports', {
198
- /******/ enumerable: true,
199
- /******/ set: function() {
200
- /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
201
- /******/ }
202
- /******/ });
203
- /******/ return module;
204
- /******/ };
205
- /******/ }();
206
- /******/
207
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
208
- /******/ !function() {
209
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
210
- /******/ }();
211
- /******/
212
- /************************************************************************/
213
- /******/
214
- /******/ // module cache are used so entry inlining is disabled
215
- /******/ // startup
216
- /******/ // Load entry module and return exports
217
- /******/ var __webpack_exports__ = __webpack_require__(5);
218
- /******/ var __webpack_exports__MAXIMAL_NUMBER_OF_ITERATIONS = __webpack_exports__.$Q;
219
- /******/ var __webpack_exports__NOOP = __webpack_exports__.tE;
220
- /******/ var __webpack_exports__globalContext = __webpack_exports__.Lz;
221
- /******/ var __webpack_exports__mockConsole = __webpack_exports__.QH;
222
- /******/ var __webpack_exports__setGlobalContext = __webpack_exports__.zm;
223
- /******/ export { __webpack_exports__MAXIMAL_NUMBER_OF_ITERATIONS as MAXIMAL_NUMBER_OF_ITERATIONS, __webpack_exports__NOOP as NOOP, __webpack_exports__globalContext as globalContext, __webpack_exports__mockConsole as mockConsole, __webpack_exports__setGlobalContext as setGlobalContext };
224
- /******/
19
+ */
20
+ import { CONSOLE_METHODS } from "./constants.js";
21
+ import { determineGlobalContext, optionalImport, optionalRequire } from "./module.js";
22
+ export let globalContext = determineGlobalContext();
23
+ export const setGlobalContext = context => {
24
+ globalContext = context;
25
+ };
26
+ globalContext.fetch = globalContext.fetch ? globalContext.fetch.bind(globalContext) : optionalRequire('node-fetch')?.default ?? ((...parameters) => optionalImport(/* webpackIgnore: true */'node-fetch').then(module => module.default(...parameters)));
27
+ export const MAXIMAL_NUMBER_OF_ITERATIONS = {
28
+ value: 100
29
+ };
30
+ // A no-op dummy function.
31
+ export const NOOP = () => {
32
+ // Do nothing.
33
+ };
34
+ export const mockConsole = () => {
35
+ // Avoid errors in browsers that lack a console.
36
+ if (!Object.prototype.hasOwnProperty.call(globalContext, 'console')) globalContext.console = {};
37
+ if (!globalContext.console) globalContext.console = {};
38
+ for (const methodName of CONSOLE_METHODS) if (!(methodName in globalContext.console)) globalContext.console[methodName] = NOOP;
39
+ };
40
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2NvbnRleHQudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gIyEvdXNyL2Jpbi9lbnYgYmFiZWwtbm9kZVxuLy8gLSotIGNvZGluZzogdXRmLTggLSotXG4vKiogQG1vZHVsZSBjb250ZXh0ICovXG4ndXNlIHN0cmljdCdcbi8qICFcbiAgICByZWdpb24gaGVhZGVyXG4gICAgW1Byb2plY3QgcGFnZV0oaHR0cHM6Ly90b3JiZW4ud2Vic2l0ZS9jbGllbnRub2RlKVxuXG4gICAgQ29weXJpZ2h0IFRvcmJlbiBTaWNrZXJ0IChpbmZvW1wifmF0flwiXXRvcmJlbi53ZWJzaXRlKSAxNi4xMi4yMDEyXG5cbiAgICBMaWNlbnNlXG4gICAgLS0tLS0tLVxuXG4gICAgVGhpcyBsaWJyYXJ5IHdyaXR0ZW4gYnkgVG9yYmVuIFNpY2tlcnQgc3RhbmRzIHVuZGVyIGEgY3JlYXRpdmUgY29tbW9uc1xuICAgIG5hbWluZyAzLjAgdW5wb3J0ZWQgbGljZW5zZS5cbiAgICBTZWUgaHR0cHM6Ly9jcmVhdGl2ZWNvbW1vbnMub3JnL2xpY2Vuc2VzL2J5LzMuMC9kZWVkLmRlXG4gICAgZW5kcmVnaW9uXG4qL1xuaW1wb3J0IHR5cGUge0FueUZ1bmN0aW9uLCBNYXBwaW5nfSBmcm9tICcuL3R5cGUnXG5cbmltcG9ydCB7Q09OU09MRV9NRVRIT0RTfSBmcm9tICcuL2NvbnN0YW50cydcbmltcG9ydCB7XG4gICAgZGV0ZXJtaW5lR2xvYmFsQ29udGV4dCwgb3B0aW9uYWxJbXBvcnQsIG9wdGlvbmFsUmVxdWlyZVxufSBmcm9tICcuL21vZ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119
package/dist/cookie.js CHANGED
@@ -1,48 +1,9 @@
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 */ Lz: function() { return /* binding */ globalContext; }
8
- /* harmony export */ });
9
- /* unused harmony exports setGlobalContext, MAXIMAL_NUMBER_OF_ITERATIONS, NOOP, mockConsole */
10
- /* unused harmony import specifier */ var CONSOLE_METHODS;
11
- /* harmony import */ var _module_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
12
1
  // #!/usr/bin/env babel-node
13
2
  // -*- coding: utf-8 -*-
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
3
+ /** @module cookie */
4
+ 'use strict';
19
5
 
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
- /***/ }),
33
-
34
- /***/ 23:
35
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
36
-
37
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
38
- /* harmony export */ Ri: function() { return /* binding */ getCookie; },
39
- /* harmony export */ TV: function() { return /* binding */ setCookie; },
40
- /* harmony export */ Yj: function() { return /* binding */ deleteCookie; }
41
- /* harmony export */ });
42
- /* harmony import */ var _context_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
43
- // #!/usr/bin/env babel-node
44
- // -*- coding: utf-8 -*-
45
- /** @module cookie *//* !
6
+ /* !
46
7
  region header
47
8
  [Project page](https://torben.website/clientnode)
48
9
 
@@ -55,14 +16,34 @@ if(!Object.prototype.hasOwnProperty.call(globalContext,"console"))globalContext.
55
16
  naming 3.0 unported license.
56
17
  See https://creativecommons.org/licenses/by/3.0/deed.de
57
18
  endregion
58
- */function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n};/**
19
+ */
20
+ import { globalContext } from "./context.js";
21
+
22
+ /**
59
23
  * Deletes a cookie value by given name.
60
24
  * @param name - Name to identify requested value.
61
- */var deleteCookie=function deleteCookie(name){if(_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.document)_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.document.cookie="".concat(name,"=; Max-Age=-99999999;")};/**
25
+ */
26
+ export const deleteCookie = name => {
27
+ if (globalContext.document) globalContext.document.cookie = `${name}=; Max-Age=-99999999;`;
28
+ };
29
+ /**
62
30
  * Gets a cookie value by given name.
63
31
  * @param name - Name to identify requested value.
64
32
  * @returns Requested value.
65
- */var getCookie=function getCookie(name){if(_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.document){var key="".concat(name,"=");var decodedCookie=decodeURIComponent(_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.document.cookie);var _iterator=_createForOfIteratorHelper(decodedCookie.split(";")),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var date=_step.value;while(date.startsWith(" "))date=date.substring(1);if(date.startsWith(key))return date.substring(key.length,date.length)}}catch(err){_iterator.e(err)}finally{_iterator.f()}return""}return null};/**
33
+ */
34
+ export const getCookie = name => {
35
+ if (globalContext.document) {
36
+ const key = `${name}=`;
37
+ const decodedCookie = decodeURIComponent(globalContext.document.cookie);
38
+ for (let date of decodedCookie.split(';')) {
39
+ while (date.startsWith(' ')) date = date.substring(1);
40
+ if (date.startsWith(key)) return date.substring(key.length, date.length);
41
+ }
42
+ return '';
43
+ }
44
+ return null;
45
+ };
46
+ /**
66
47
  * Sets a cookie key-value-pair.
67
48
  * @param name - Name to identify given value.
68
49
  * @param value - Value to set.
@@ -79,162 +60,25 @@ if(!Object.prototype.hasOwnProperty.call(globalContext,"console"))globalContext.
79
60
  * @param givenOptions.secure - Indicates if this cookie is only valid for
80
61
  * "https" connections.
81
62
  * @returns A boolean indicating whether cookie could be set or not.
82
- */var setCookie=function setCookie(name,value,givenOptions){if(givenOptions===void 0){givenOptions={}}if(_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.document){var _globalContext$locati;var options=_objectSpread({domain:"",httpOnly:false,minimal:false,numberOfDaysUntilExpiration:365,path:"/",sameSite:"Lax",secure:true},givenOptions);var now=new Date;now.setTime(now.getTime()+options.numberOfDaysUntilExpiration*24*60*60*1000);if(options.domain===""&&(_globalContext$locati=_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.location)!==null&&_globalContext$locati!==void 0&&_globalContext$locati.hostname)options.domain=_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.location.hostname;_context_js__WEBPACK_IMPORTED_MODULE_0__/* .globalContext */ .Lz.document.cookie="".concat(name,"=").concat(value)+(options.minimal?"":";Expires=\"".concat(now.toUTCString())+";Path=".concat(options.path)+";Domain=".concat(options.domain)+(options.sameSite?";SameSite=".concat(options.sameSite):"")+(options.secure?";Secure":"")+(options.httpOnly?";HttpOnly":""));return true}return false};
83
-
84
- /***/ }),
85
-
86
- /***/ 2:
87
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
88
-
89
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
90
- /* harmony export */ I5: function() { return /* binding */ optionalRequire; },
91
- /* harmony export */ Sw: function() { return /* binding */ optionalImport; },
92
- /* harmony export */ a8: function() { return /* binding */ determineGlobalContext; }
93
- /* harmony export */ });
94
- /* unused harmony exports isImportSyntaxSupported, currentRequire, setOptionalRequire, getCurrentRequire, clearRequireCache, isolatedRequire */
95
- /* module decorator */ module = __webpack_require__.hmd(module);
96
- // #!/usr/bin/env babel-node
97
- // -*- coding: utf-8 -*-
98
- /** @module module *//* !
99
- region header
100
- [Project page](https://torben.website/clientnode)
101
-
102
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
103
-
104
- License
105
- -------
106
-
107
- This library written by Torben Sickert stands under a creative commons
108
- naming 3.0 unported license.
109
- See https://creativecommons.org/licenses/by/3.0/deed.de
110
- endregion
111
- */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
112
- 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.
113
- 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;/*
114
- eslint-enable
115
- @typescript-eslint/no-implied-eval,
116
- @typescript-eslint/no-unsafe-call
117
- */// eslint-disable-next-line @typescript-eslint/no-unsafe-call
118
- 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
119
- }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}();
120
-
121
- /***/ }),
122
-
123
- /***/ 6:
124
- /***/ (function(module) {
125
-
126
- function webpackEmptyContext(req) {
127
- var e = new Error("Cannot find module '" + req + "'");
128
- e.code = 'MODULE_NOT_FOUND';
129
- throw e;
130
- }
131
- webpackEmptyContext.keys = function() { return []; };
132
- webpackEmptyContext.resolve = webpackEmptyContext;
133
- webpackEmptyContext.id = 6;
134
- module.exports = webpackEmptyContext;
135
-
136
- /***/ })
137
-
138
- /******/ });
139
- /************************************************************************/
140
- /******/ // The module cache
141
- /******/ var __webpack_module_cache__ = {};
142
- /******/
143
- /******/ // The require function
144
- /******/ function __webpack_require__(moduleId) {
145
- /******/ // Check if module is in cache
146
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
147
- /******/ if (cachedModule !== undefined) {
148
- /******/ return cachedModule.exports;
149
- /******/ }
150
- /******/ // Create a new module (and put it into the cache)
151
- /******/ var module = __webpack_module_cache__[moduleId] = {
152
- /******/ id: moduleId,
153
- /******/ loaded: false,
154
- /******/ exports: {}
155
- /******/ };
156
- /******/
157
- /******/ // Execute the module function
158
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
159
- /******/
160
- /******/ // Flag the module as loaded
161
- /******/ module.loaded = true;
162
- /******/
163
- /******/ // Return the exports of the module
164
- /******/ return module.exports;
165
- /******/ }
166
- /******/
167
- /******/ // expose the module cache
168
- /******/ __webpack_require__.c = __webpack_module_cache__;
169
- /******/
170
- /************************************************************************/
171
- /******/ /* webpack/runtime/define property getters */
172
- /******/ !function() {
173
- /******/ // define getter/value functions for harmony exports
174
- /******/ __webpack_require__.d = function(exports, definition) {
175
- /******/ if(Array.isArray(definition)) {
176
- /******/ var i = 0;
177
- /******/ while(i < definition.length) {
178
- /******/ var key = definition[i++];
179
- /******/ var binding = definition[i++];
180
- /******/ if(!__webpack_require__.o(exports, key)) {
181
- /******/ if(binding === 0) {
182
- /******/ Object.defineProperty(exports, key, { enumerable: true, value: definition[i++] });
183
- /******/ } else {
184
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: binding });
185
- /******/ }
186
- /******/ } else if(binding === 0) { i++; }
187
- /******/ }
188
- /******/ } else {
189
- /******/ for(var key in definition) {
190
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
191
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
192
- /******/ }
193
- /******/ }
194
- /******/ }
195
- /******/ };
196
- /******/ }();
197
- /******/
198
- /******/ /* webpack/runtime/global */
199
- /******/ !function() {
200
- /******/ __webpack_require__.g = (function() {
201
- /******/ if (typeof globalThis === 'object') return globalThis;
202
- /******/ try {
203
- /******/ return this || new Function('return this')();
204
- /******/ } catch (e) {
205
- /******/ if (typeof window === 'object') return window;
206
- /******/ }
207
- /******/ })();
208
- /******/ }();
209
- /******/
210
- /******/ /* webpack/runtime/harmony module decorator */
211
- /******/ !function() {
212
- /******/ __webpack_require__.hmd = function(module) {
213
- /******/ module = Object.create(module);
214
- /******/ if (!module.children) module.children = [];
215
- /******/ Object.defineProperty(module, 'exports', {
216
- /******/ enumerable: true,
217
- /******/ set: function() {
218
- /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
219
- /******/ }
220
- /******/ });
221
- /******/ return module;
222
- /******/ };
223
- /******/ }();
224
- /******/
225
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
226
- /******/ !function() {
227
- /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
228
- /******/ }();
229
- /******/
230
- /************************************************************************/
231
- /******/
232
- /******/ // module cache are used so entry inlining is disabled
233
- /******/ // startup
234
- /******/ // Load entry module and return exports
235
- /******/ var __webpack_exports__ = __webpack_require__(23);
236
- /******/ var __webpack_exports__deleteCookie = __webpack_exports__.Yj;
237
- /******/ var __webpack_exports__getCookie = __webpack_exports__.Ri;
238
- /******/ var __webpack_exports__setCookie = __webpack_exports__.TV;
239
- /******/ export { __webpack_exports__deleteCookie as deleteCookie, __webpack_exports__getCookie as getCookie, __webpack_exports__setCookie as setCookie };
240
- /******/
63
+ */
64
+ export const setCookie = (name, value, givenOptions = {}) => {
65
+ if (globalContext.document) {
66
+ const options = {
67
+ domain: '',
68
+ httpOnly: false,
69
+ minimal: false,
70
+ numberOfDaysUntilExpiration: 365,
71
+ path: '/',
72
+ sameSite: 'Lax',
73
+ secure: true,
74
+ ...givenOptions
75
+ };
76
+ const now = new Date();
77
+ now.setTime(now.getTime() + options.numberOfDaysUntilExpiration * 24 * 60 * 60 * 1000);
78
+ if (options.domain === '' && globalContext.location?.hostname) options.domain = globalContext.location.hostname;
79
+ globalContext.document.cookie = `${name}=${value}` + (options.minimal ? '' : `;Expires="${now.toUTCString()}` + `;Path=${options.path}` + `;Domain=${options.domain}` + (options.sameSite ? `;SameSite=${options.sameSite}` : '') + (options.secure ? ';Secure' : '') + (options.httpOnly ? ';HttpOnly' : ''));
80
+ return true;
81
+ }
82
+ return false;
83
+ };
84
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOlsiLi4vc3JjL2Nvb2tpZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyAjIS91c3IvYmluL2VudiBiYWJlbC1ub2RlXG4vLyAtKi0gY29kaW5nOiB1dGYtOCAtKi1cbi8qKiBAbW9kdWxlIGNvb2tpZSAqL1xuJ3VzZSBzdHJpY3QnXG4vKiAhXG4gICAgcmVnaW9uIGhlYWRlclxuICAgIFtQcm9qZWN0IHBhZ2VdKGh0dHBzOi8vdG9yYmVuLndlYnNpdGUvY2xpZW50bm9kZSlcblxuICAgIENvcHlyaWdodCBUb3JiZW4gU2lja2VydCAoaW5mb1tcIn5hdH5cIl10b3JiZW4ud2Vic2l0ZSkgMTYuMTIuMjAxMlxuXG4gICAgTGljZW5zZVxuICAgIC0tLS0tLS1cblxuICAgIFRoaXMgbGlicmFyeSB3cml0dGVuIGJ5IFRvcmJlbiBTaWNrZXJ0IHN0Y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ICAgICAgICAgICAgLi4uZ2l2ZW5PcHRpb25zXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBub3cgPSBuZXcgRGF0ZSgpXG4gICAgICAgIG5vdy5zZXRUaW1lKFxuICAgICAgICAgICAgbm93LmdldFRpbWUoKSArXG4gICAgICAgICAgICAob3B0aW9ucy5udW1iZXJPZkRheXNVbnRpbEV4cGlyYXRpb24gKiAyNCAqIDYwICogNjAgKiAxMDAwKVxuICAgICAgICApXG5cbiAgICAgICAgaWYgKG9wdGlvbnMuZG9tYWluID09PSAnJyAmJiBnbG9iYWxDb250ZXh0LmxvY2F0aW9uPy5ob3N0bmFtZSlcbiAgICAgICAgICAgIG9wdGlvbnMuZG9tYWluID0gZ2xvYmFsQ29udGV4dC5sb2NhdGlvbi5ob3N0bmFtZVxuXG4gICAgICAgIGdsb2JhbENvbnRleHQuZG9jdW1lbnQuY29va2llID1cbiAgICAgICAgICAgIGAke25hbWV9PSR7dmFsdWV9YCArXG4gICAgICAgICAgICAoXG4gICAgICAgICAgICAgICAgb3B0aW9ucy5taW5pbWFsID9cbiAgICAgICAgICAgICAgICAgICAgJycgOlxuICAgICAgICAgICAgICAgICAgICAoXG4gICAgICAgICAgICAgICAgICAgICAgICBgO0V4cGlyZXM9XCIke25vdy50b1VUQ1N0cmluZygpfWAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgYDtQYXRoPSR7b3B0aW9ucy5wYXRofWAgK1xuICAgICAgICAgICAgICAgICAgICAgICAgYDtEb21haW49JHtvcHRpb25zLmRvbWFpbn1gICtcbiAgICAgICAgICAgICAgICAgICAgICAgIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNhbWVTaXRlID9cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYDtTYW1lU2l0ZT0ke29wdGlvbnMuc2FtZVNpdGV9YCA6XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICcnXG4gICAgICAgICAgICAgICAgICAgICAgICApICt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