vigor-fetch 3.1.4 → 3.1.6
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.
- package/dist/index.d.ts +4 -0
- package/dist/index.js +0 -4
- package/dist/index.mjs +0 -4
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -120,6 +120,7 @@ type VigorRetryAlgorithmsConstantConfig = {
|
|
|
120
120
|
declare class VigorRetryAlgorithmsConstant extends VigorStatus<VigorRetryAlgorithmsConstantConfig, VigorRetryAlgorithmsConstant> {
|
|
121
121
|
constructor(config?: Partial<VigorRetryAlgorithmsConstantConfig>);
|
|
122
122
|
interval(num: VigorRetryAlgorithmsConstantConfig["interval"]): VigorRetryAlgorithmsConstant;
|
|
123
|
+
_calculateDelay(attempt: number): number;
|
|
123
124
|
}
|
|
124
125
|
type VigorRetryAlgorithmsLinearConfig = {
|
|
125
126
|
initial: number;
|
|
@@ -133,6 +134,7 @@ declare class VigorRetryAlgorithmsLinear extends VigorStatus<VigorRetryAlgorithm
|
|
|
133
134
|
increment(num: VigorRetryAlgorithmsLinearConfig["increment"]): VigorRetryAlgorithmsLinear;
|
|
134
135
|
minDelay(num: VigorRetryAlgorithmsLinearConfig["minDelay"]): VigorRetryAlgorithmsLinear;
|
|
135
136
|
maxDelay(num: VigorRetryAlgorithmsLinearConfig["maxDelay"]): VigorRetryAlgorithmsLinear;
|
|
137
|
+
_calculateDelay(attempt: number): number;
|
|
136
138
|
}
|
|
137
139
|
type VigorRetryAlgorithmsBackoffConfig = {
|
|
138
140
|
initial: number;
|
|
@@ -148,6 +150,7 @@ declare class VigorRetryAlgorithmsBackoff extends VigorStatus<VigorRetryAlgorith
|
|
|
148
150
|
unit(num: VigorRetryAlgorithmsBackoffConfig["unit"]): VigorRetryAlgorithmsBackoff;
|
|
149
151
|
minDelay(num: VigorRetryAlgorithmsBackoffConfig["minDelay"]): VigorRetryAlgorithmsBackoff;
|
|
150
152
|
maxDelay(num: VigorRetryAlgorithmsBackoffConfig["maxDelay"]): VigorRetryAlgorithmsBackoff;
|
|
153
|
+
_calculateDelay(attempt: number): number;
|
|
151
154
|
}
|
|
152
155
|
type VigorRetryAlgorithmsCustomConfig = {
|
|
153
156
|
func: VigorRetryAlgorithmsConfig;
|
|
@@ -157,6 +160,7 @@ type VigorRetryAlgorithmsCustomConfig = {
|
|
|
157
160
|
declare class VigorRetryAlgorithmsCustom extends VigorStatus<VigorRetryAlgorithmsCustomConfig, VigorRetryAlgorithmsCustom> {
|
|
158
161
|
constructor(config?: Partial<VigorRetryAlgorithmsCustomConfig>);
|
|
159
162
|
func(num: VigorRetryAlgorithmsCustomConfig["func"]): VigorRetryAlgorithmsCustom;
|
|
163
|
+
_calculateDelay(attempt: number): number;
|
|
160
164
|
}
|
|
161
165
|
type VigorRetryAlgorithmsConfig = (attempt: number) => number;
|
|
162
166
|
type VigorRetryInterceptorsApi<R> = {
|
package/dist/index.js
CHANGED
|
@@ -130,7 +130,6 @@ class VigorRetryAlgorithmsConstant extends VigorStatus {
|
|
|
130
130
|
super(config, base, (c) => new VigorRetryAlgorithmsConstant(c));
|
|
131
131
|
}
|
|
132
132
|
interval(num) { return this._next({ interval: num }); }
|
|
133
|
-
/** @internal */
|
|
134
133
|
_calculateDelay(attempt) {
|
|
135
134
|
return this._config.interval;
|
|
136
135
|
}
|
|
@@ -149,7 +148,6 @@ class VigorRetryAlgorithmsLinear extends VigorStatus {
|
|
|
149
148
|
increment(num) { return this._next({ increment: num }); }
|
|
150
149
|
minDelay(num) { return this._next({ minDelay: num }); }
|
|
151
150
|
maxDelay(num) { return this._next({ maxDelay: num }); }
|
|
152
|
-
/** @internal */
|
|
153
151
|
_calculateDelay(attempt) {
|
|
154
152
|
const { initial, increment, minDelay, maxDelay } = this._config;
|
|
155
153
|
return Math.max(minDelay, Math.min(maxDelay, initial + increment * attempt));
|
|
@@ -171,7 +169,6 @@ class VigorRetryAlgorithmsBackoff extends VigorStatus {
|
|
|
171
169
|
unit(num) { return this._next({ unit: num }); }
|
|
172
170
|
minDelay(num) { return this._next({ minDelay: num }); }
|
|
173
171
|
maxDelay(num) { return this._next({ maxDelay: num }); }
|
|
174
|
-
/** @internal */
|
|
175
172
|
_calculateDelay(attempt) {
|
|
176
173
|
const { initial, multiplier, unit, minDelay, maxDelay } = this._config;
|
|
177
174
|
return Math.max(minDelay, Math.min(maxDelay, initial + unit * Math.pow(multiplier, attempt)));
|
|
@@ -187,7 +184,6 @@ class VigorRetryAlgorithmsCustom extends VigorStatus {
|
|
|
187
184
|
super(config, base, (c) => new VigorRetryAlgorithmsCustom(c));
|
|
188
185
|
}
|
|
189
186
|
func(num) { return this._next({ func: num }); }
|
|
190
|
-
/** @internal */
|
|
191
187
|
_calculateDelay(attempt) {
|
|
192
188
|
const { func, minDelay, maxDelay } = this._config;
|
|
193
189
|
return Math.max(minDelay, Math.min(maxDelay, func(attempt)));
|
package/dist/index.mjs
CHANGED
|
@@ -126,7 +126,6 @@ class VigorRetryAlgorithmsConstant extends VigorStatus {
|
|
|
126
126
|
super(config, base, (c) => new VigorRetryAlgorithmsConstant(c));
|
|
127
127
|
}
|
|
128
128
|
interval(num) { return this._next({ interval: num }); }
|
|
129
|
-
/** @internal */
|
|
130
129
|
_calculateDelay(attempt) {
|
|
131
130
|
return this._config.interval;
|
|
132
131
|
}
|
|
@@ -145,7 +144,6 @@ class VigorRetryAlgorithmsLinear extends VigorStatus {
|
|
|
145
144
|
increment(num) { return this._next({ increment: num }); }
|
|
146
145
|
minDelay(num) { return this._next({ minDelay: num }); }
|
|
147
146
|
maxDelay(num) { return this._next({ maxDelay: num }); }
|
|
148
|
-
/** @internal */
|
|
149
147
|
_calculateDelay(attempt) {
|
|
150
148
|
const { initial, increment, minDelay, maxDelay } = this._config;
|
|
151
149
|
return Math.max(minDelay, Math.min(maxDelay, initial + increment * attempt));
|
|
@@ -167,7 +165,6 @@ class VigorRetryAlgorithmsBackoff extends VigorStatus {
|
|
|
167
165
|
unit(num) { return this._next({ unit: num }); }
|
|
168
166
|
minDelay(num) { return this._next({ minDelay: num }); }
|
|
169
167
|
maxDelay(num) { return this._next({ maxDelay: num }); }
|
|
170
|
-
/** @internal */
|
|
171
168
|
_calculateDelay(attempt) {
|
|
172
169
|
const { initial, multiplier, unit, minDelay, maxDelay } = this._config;
|
|
173
170
|
return Math.max(minDelay, Math.min(maxDelay, initial + unit * Math.pow(multiplier, attempt)));
|
|
@@ -183,7 +180,6 @@ class VigorRetryAlgorithmsCustom extends VigorStatus {
|
|
|
183
180
|
super(config, base, (c) => new VigorRetryAlgorithmsCustom(c));
|
|
184
181
|
}
|
|
185
182
|
func(num) { return this._next({ func: num }); }
|
|
186
|
-
/** @internal */
|
|
187
183
|
_calculateDelay(attempt) {
|
|
188
184
|
const { func, minDelay, maxDelay } = this._config;
|
|
189
185
|
return Math.max(minDelay, Math.min(maxDelay, func(attempt)));
|