retry-axios
Advanced tools
Comparing version 2.2.0 to 2.2.1
@@ -1,2 +0,2 @@ | ||
var e,t=(e=require("axios"))&&"object"==typeof e&&"default"in e?e.default:e;function r(e){return e}function n(e){var t=[];if(e)return Array.isArray(e)?e:("object"==typeof e&&Object.keys(e).forEach(function(r){"number"==typeof r&&(t[r]=e[r])}),t)}function o(e){if(t.isCancel(e))return Promise.reject(e);var r=s(e)||{};if(r.currentRetryAttempt=r.currentRetryAttempt||0,r.retry=null==r.retry?3:r.retry,r.retryDelay=r.retryDelay||100,r.instance=r.instance||t,r.backoffType=r.backoffType||"exponential",r.httpMethodsToRetry=n(r.httpMethodsToRetry)||["GET","HEAD","PUT","OPTIONS","DELETE"],r.noResponseRetries=null==r.noResponseRetries?2:r.noResponseRetries,r.statusCodesToRetry=n(r.statusCodesToRetry)||[[100,199],[429,429],[500,599]],e.config.raxConfig=Object.assign({},r),!(r.shouldRetry||function(e){var t=e.config.raxConfig;if(!t||0===t.retry)return!1;if(!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries)return!1;if(!e.config.method||t.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){for(var r=!1,n=0,o=t.statusCodesToRetry;n<o.length;n+=1){var s=o[n],i=e.response.status;if(i>=s[0]&&i<=s[1]){r=!0;break}}if(!r)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)})(e))return Promise.reject(e);var o=new Promise(function(t){var n;n="linear"===r.backoffType?1e3*r.currentRetryAttempt:"static"===r.backoffType?r.retryDelay:(Math.pow(2,r.currentRetryAttempt)-1)/2*1e3,e.config.raxConfig.currentRetryAttempt+=1,setTimeout(t,n)}),i=r.onRetryAttempt?Promise.resolve(r.onRetryAttempt(e)):Promise.resolve();return Promise.resolve().then(function(){return o}).then(function(){return i}).then(function(){return r.instance.request(e.config)})}function s(e){if(e&&e.config)return e.config.raxConfig}exports.attach=function(e){return(e=e||t).interceptors.response.use(r,o)},exports.detach=function(e,r){(r=r||t).interceptors.response.eject(e)},exports.getConfig=s; | ||
var e,t=(e=require("axios"))&&"object"==typeof e&&"default"in e?e.default:e;function r(e){return e}function n(e){var t=[];if(e)return Array.isArray(e)?e:("object"==typeof e&&Object.keys(e).forEach(function(r){"number"==typeof r&&(t[r]=e[r])}),t)}function o(e){if(t.isCancel(e))return Promise.reject(e);var r=s(e)||{};if(r.currentRetryAttempt=r.currentRetryAttempt||0,r.retry=null==r.retry?3:r.retry,r.retryDelay=r.retryDelay||100,r.instance=r.instance||t,r.backoffType=r.backoffType||"exponential",r.httpMethodsToRetry=n(r.httpMethodsToRetry)||["GET","HEAD","PUT","OPTIONS","DELETE"],r.noResponseRetries=null==r.noResponseRetries?2:r.noResponseRetries,r.statusCodesToRetry=n(r.statusCodesToRetry)||[[100,199],[429,429],[500,599]],e.config=e.config||{},e.config.raxConfig=Object.assign({},r),!(r.shouldRetry||function(e){var t=e.config.raxConfig;if(!t||0===t.retry)return!1;if(!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries)return!1;if(!e.config.method||t.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){for(var r=!1,n=0,o=t.statusCodesToRetry;n<o.length;n+=1){var s=o[n],i=e.response.status;if(i>=s[0]&&i<=s[1]){r=!0;break}}if(!r)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)})(e))return Promise.reject(e);var o=new Promise(function(t){var n;n="linear"===r.backoffType?1e3*r.currentRetryAttempt:"static"===r.backoffType?r.retryDelay:(Math.pow(2,r.currentRetryAttempt)-1)/2*1e3,e.config.raxConfig.currentRetryAttempt+=1,setTimeout(t,n)}),i=r.onRetryAttempt?Promise.resolve(r.onRetryAttempt(e)):Promise.resolve();return Promise.resolve().then(function(){return o}).then(function(){return i}).then(function(){return r.instance.request(e.config)})}function s(e){if(e&&e.config)return e.config.raxConfig}exports.attach=function(e){return(e=e||t).interceptors.response.use(r,o)},exports.detach=function(e,r){(r=r||t).interceptors.response.eject(e)},exports.getConfig=s; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import e from"axios";function t(t){return(t=t||e).interceptors.response.use(n,s)}function r(t,r){(r=r||e).interceptors.response.eject(t)}function n(e){return e}function o(e){var t=[];if(e)return Array.isArray(e)?e:("object"==typeof e&&Object.keys(e).forEach(function(r){"number"==typeof r&&(t[r]=e[r])}),t)}function s(t){if(e.isCancel(t))return Promise.reject(t);var r=i(t)||{};if(r.currentRetryAttempt=r.currentRetryAttempt||0,r.retry=null==r.retry?3:r.retry,r.retryDelay=r.retryDelay||100,r.instance=r.instance||e,r.backoffType=r.backoffType||"exponential",r.httpMethodsToRetry=o(r.httpMethodsToRetry)||["GET","HEAD","PUT","OPTIONS","DELETE"],r.noResponseRetries=null==r.noResponseRetries?2:r.noResponseRetries,r.statusCodesToRetry=o(r.statusCodesToRetry)||[[100,199],[429,429],[500,599]],t.config.raxConfig=Object.assign({},r),!(r.shouldRetry||function(e){var t=e.config.raxConfig;if(!t||0===t.retry)return!1;if(!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries)return!1;if(!e.config.method||t.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){for(var r=!1,n=0,o=t.statusCodesToRetry;n<o.length;n+=1){var s=o[n],i=e.response.status;if(i>=s[0]&&i<=s[1]){r=!0;break}}if(!r)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)})(t))return Promise.reject(t);var n=new Promise(function(e){var n;n="linear"===r.backoffType?1e3*r.currentRetryAttempt:"static"===r.backoffType?r.retryDelay:(Math.pow(2,r.currentRetryAttempt)-1)/2*1e3,t.config.raxConfig.currentRetryAttempt+=1,setTimeout(e,n)}),s=r.onRetryAttempt?Promise.resolve(r.onRetryAttempt(t)):Promise.resolve();return Promise.resolve().then(function(){return n}).then(function(){return s}).then(function(){return r.instance.request(t.config)})}function i(e){if(e&&e.config)return e.config.raxConfig}export{t as attach,r as detach,i as getConfig}; | ||
import e from"axios";function t(t){return(t=t||e).interceptors.response.use(n,s)}function r(t,r){(r=r||e).interceptors.response.eject(t)}function n(e){return e}function o(e){var t=[];if(e)return Array.isArray(e)?e:("object"==typeof e&&Object.keys(e).forEach(function(r){"number"==typeof r&&(t[r]=e[r])}),t)}function s(t){if(e.isCancel(t))return Promise.reject(t);var r=i(t)||{};if(r.currentRetryAttempt=r.currentRetryAttempt||0,r.retry=null==r.retry?3:r.retry,r.retryDelay=r.retryDelay||100,r.instance=r.instance||e,r.backoffType=r.backoffType||"exponential",r.httpMethodsToRetry=o(r.httpMethodsToRetry)||["GET","HEAD","PUT","OPTIONS","DELETE"],r.noResponseRetries=null==r.noResponseRetries?2:r.noResponseRetries,r.statusCodesToRetry=o(r.statusCodesToRetry)||[[100,199],[429,429],[500,599]],t.config=t.config||{},t.config.raxConfig=Object.assign({},r),!(r.shouldRetry||function(e){var t=e.config.raxConfig;if(!t||0===t.retry)return!1;if(!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries)return!1;if(!e.config.method||t.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){for(var r=!1,n=0,o=t.statusCodesToRetry;n<o.length;n+=1){var s=o[n],i=e.response.status;if(i>=s[0]&&i<=s[1]){r=!0;break}}if(!r)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)})(t))return Promise.reject(t);var n=new Promise(function(e){var n;n="linear"===r.backoffType?1e3*r.currentRetryAttempt:"static"===r.backoffType?r.retryDelay:(Math.pow(2,r.currentRetryAttempt)-1)/2*1e3,t.config.raxConfig.currentRetryAttempt+=1,setTimeout(e,n)}),s=r.onRetryAttempt?Promise.resolve(r.onRetryAttempt(t)):Promise.resolve();return Promise.resolve().then(function(){return n}).then(function(){return s}).then(function(){return r.instance.request(t.config)})}function i(e){if(e&&e.config)return e.config.raxConfig}export{t as attach,r as detach,i as getConfig}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],t):t(e.retryAxios={},e.axios)}(this,function(e,t){function r(e){return e}function n(e){var t=[];if(e)return Array.isArray(e)?e:("object"==typeof e&&Object.keys(e).forEach(function(r){"number"==typeof r&&(t[r]=e[r])}),t)}function o(e){if(t.isCancel(e))return Promise.reject(e);var r=s(e)||{};if(r.currentRetryAttempt=r.currentRetryAttempt||0,r.retry=null==r.retry?3:r.retry,r.retryDelay=r.retryDelay||100,r.instance=r.instance||t,r.backoffType=r.backoffType||"exponential",r.httpMethodsToRetry=n(r.httpMethodsToRetry)||["GET","HEAD","PUT","OPTIONS","DELETE"],r.noResponseRetries=null==r.noResponseRetries?2:r.noResponseRetries,r.statusCodesToRetry=n(r.statusCodesToRetry)||[[100,199],[429,429],[500,599]],e.config.raxConfig=Object.assign({},r),!(r.shouldRetry||function(e){var t=e.config.raxConfig;if(!t||0===t.retry)return!1;if(!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries)return!1;if(!e.config.method||t.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){for(var r=!1,n=0,o=t.statusCodesToRetry;n<o.length;n+=1){var s=o[n],i=e.response.status;if(i>=s[0]&&i<=s[1]){r=!0;break}}if(!r)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)})(e))return Promise.reject(e);var o=new Promise(function(t){var n;n="linear"===r.backoffType?1e3*r.currentRetryAttempt:"static"===r.backoffType?r.retryDelay:(Math.pow(2,r.currentRetryAttempt)-1)/2*1e3,e.config.raxConfig.currentRetryAttempt+=1,setTimeout(t,n)}),i=r.onRetryAttempt?Promise.resolve(r.onRetryAttempt(e)):Promise.resolve();return Promise.resolve().then(function(){return o}).then(function(){return i}).then(function(){return r.instance.request(e.config)})}function s(e){if(e&&e.config)return e.config.raxConfig}t=t&&t.hasOwnProperty("default")?t.default:t,e.attach=function(e){return(e=e||t).interceptors.response.use(r,o)},e.detach=function(e,r){(r=r||t).interceptors.response.eject(e)},e.getConfig=s}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("axios")):"function"==typeof define&&define.amd?define(["exports","axios"],t):t(e.retryAxios={},e.axios)}(this,function(e,t){function r(e){return e}function n(e){var t=[];if(e)return Array.isArray(e)?e:("object"==typeof e&&Object.keys(e).forEach(function(r){"number"==typeof r&&(t[r]=e[r])}),t)}function o(e){if(t.isCancel(e))return Promise.reject(e);var r=s(e)||{};if(r.currentRetryAttempt=r.currentRetryAttempt||0,r.retry=null==r.retry?3:r.retry,r.retryDelay=r.retryDelay||100,r.instance=r.instance||t,r.backoffType=r.backoffType||"exponential",r.httpMethodsToRetry=n(r.httpMethodsToRetry)||["GET","HEAD","PUT","OPTIONS","DELETE"],r.noResponseRetries=null==r.noResponseRetries?2:r.noResponseRetries,r.statusCodesToRetry=n(r.statusCodesToRetry)||[[100,199],[429,429],[500,599]],e.config=e.config||{},e.config.raxConfig=Object.assign({},r),!(r.shouldRetry||function(e){var t=e.config.raxConfig;if(!t||0===t.retry)return!1;if(!e.response&&(t.currentRetryAttempt||0)>=t.noResponseRetries)return!1;if(!e.config.method||t.httpMethodsToRetry.indexOf(e.config.method.toUpperCase())<0)return!1;if(e.response&&e.response.status){for(var r=!1,n=0,o=t.statusCodesToRetry;n<o.length;n+=1){var s=o[n],i=e.response.status;if(i>=s[0]&&i<=s[1]){r=!0;break}}if(!r)return!1}return t.currentRetryAttempt=t.currentRetryAttempt||0,!(t.currentRetryAttempt>=t.retry)})(e))return Promise.reject(e);var o=new Promise(function(t){var n;n="linear"===r.backoffType?1e3*r.currentRetryAttempt:"static"===r.backoffType?r.retryDelay:(Math.pow(2,r.currentRetryAttempt)-1)/2*1e3,e.config.raxConfig.currentRetryAttempt+=1,setTimeout(t,n)}),i=r.onRetryAttempt?Promise.resolve(r.onRetryAttempt(e)):Promise.resolve();return Promise.resolve().then(function(){return o}).then(function(){return i}).then(function(){return r.instance.request(e.config)})}function s(e){if(e&&e.config)return e.config.raxConfig}t=t&&t.hasOwnProperty("default")?t.default:t,e.attach=function(e){return(e=e||t).interceptors.response.use(r,o)},e.detach=function(e,r){(r=r||t).interceptors.response.eject(e)},e.getConfig=s}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "retry-axios", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Retry HTTP requests with Axios.", | ||
@@ -52,3 +52,3 @@ "source": "src/index.ts", | ||
"microbundle": "^0.11.0", | ||
"mocha": "^7.0.0", | ||
"mocha": "^8.0.0", | ||
"nock": "^12.0.0", | ||
@@ -55,0 +55,0 @@ "semantic-release": "^17.0.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
57104
0