Skip to content

Commit

Permalink
fix: use ternary operator for retryDelay
Browse files Browse the repository at this point in the history
  • Loading branch information
wuzi committed Nov 22, 2020
1 parent 6dce42e commit 030d3c7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ function onError(err: AxiosError) {
config.currentRetryAttempt = config.currentRetryAttempt || 0;
config.retry =
config.retry === undefined || config.retry === null ? 3 : config.retry;
config.retryDelay = config.retryDelay ?? 100;
config.retryDelay =
config.retryDelay === undefined || config.retryDelay === null
? 100
: config.retryDelay;
config.instance = config.instance || axios;
config.backoffType = config.backoffType || 'exponential';
config.httpMethodsToRetry = normalizeArray(config.httpMethodsToRetry) || [
Expand Down

0 comments on commit 030d3c7

Please sign in to comment.