manner.js 1.0.22 → 1.0.23

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.
@@ -1 +1 @@
1
- Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;class ClientFetch{constructor(){this.filters={},this.hasTimeout=!0,this.idx=0,this.abortControllers=[]}setHasTimeout(t){if("boolean"!=typeof hashTimeout)throw new Error("[Error] The parameter has a timeout and needs to be a boolean type.");this.hasTimeout=t}addFilter(t,r){if(!(Number.isInteger(t)&&0<=t))throw new Error("[Error] The parameter status code should be a positive integer type.");if("function"!=typeof r)throw new Error("[Error] The parameter callback should be4 of function type.");var e=this.filters;if(void 0!==e[t])throw new Error("[Error] The current status code has been bound.");e[t]=r}renew(){var t=this.abortControllers;t.forEach(t=>{void 0!==t&&t.abort()}),this.idx=0,this.abortControllers=[]}async fetch(t,r){var e=new AbortController,o=this.idx,i=(this.abortControllers[o]=e,this.idx+=1,this).hasTimeout;let a;if(!0===i)try{a=void 0!==r?(s=r.ownSignals,Array.isArray(s)?await fetch(t,{signal:AbortSignal.any([AbortSignal.timeout(9e3),e.signal,...s]),...r}):await fetch(t,{signal:AbortSignal.any([AbortSignal.timeout(9e3),e.signal]),...r})):await fetch(t,{signal:AbortSignal.any([AbortSignal.timeout(9e3),e.signal])})}catch(t){var i=t.name;if("TimeoutError"!==i)throw new Error("[Error] Unexpected exception occurred.");var s=this.filters;await s[512](a)}else a=await fetch(t,{...r,headers:{"Has-Timeout":"false"}});if(void 0!==a){if(a.ok)return this.abortControllers[o]=void 0,a;throw e=a.status,i=this.filters,await i[e](a),new Error("[Error] Receive an exception from the server.")}}}var _default=exports.default=ClientFetch;
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;class ClientFetch{constructor(){this.filters={},this.hasTimeout=!0,this.idx=0,this.abortControllers=[]}setHasTimeout(t){if("boolean"!=typeof t)throw new Error("[Error] The parameter has a timeout and needs to be a boolean type.");this.hasTimeout=t}addFilter(t,r){if(!(Number.isInteger(t)&&0<=t))throw new Error("[Error] The parameter status code should be a positive integer type.");if("function"!=typeof r)throw new Error("[Error] The parameter callback should be4 of function type.");var e=this.filters;if(void 0!==e[t])throw new Error("[Error] The current status code has been bound.");e[t]=r}renew(){var t=this.abortControllers;t.forEach(t=>{void 0!==t&&t.abort()}),this.idx=0,this.abortControllers=[]}async fetch(t,r){var e=new AbortController,o=this.idx,i=(this.abortControllers[o]=e,this.idx+=1,this).hasTimeout;let a;if(!0===i)try{a=void 0!==r?(s=r.ownSignals,Array.isArray(s)?await fetch(t,{signal:AbortSignal.any([AbortSignal.timeout(9e3),e.signal,...s]),...r}):await fetch(t,{signal:AbortSignal.any([AbortSignal.timeout(9e3),e.signal]),...r})):await fetch(t,{signal:AbortSignal.any([AbortSignal.timeout(9e3),e.signal])})}catch(t){var i=t.name;if("TimeoutError"!==i)throw new Error("[Error] Unexpected exception occurred.");var s=this.filters;await s[512](a)}else a=await fetch(t,{...r,headers:{"Has-Timeout":"false"}});if(void 0!==a){if(a.ok)return this.abortControllers[o]=void 0,a;throw e=a.status,i=this.filters,await i[e](a),new Error("[Error] Receive an exception from the server.")}}}var _default=exports.default=ClientFetch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "manner.js",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "Frontend mode project.",
5
5
  "repository": "git@github.com:leobrad/mode.git",
6
6
  "author": "Leo Ely",