@certik/skynet 0.20.1 → 0.20.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.20.2
4
+
5
+ - Make `options` in `withRetry` function optional
6
+
3
7
  ## 0.20.1
4
8
 
5
9
  - Update dynamodb `scanWholeTable` types
package/availability.ts CHANGED
@@ -50,11 +50,11 @@ export async function exponentialRetry<T>(
50
50
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
51
  export function withRetry<F extends (...args: any[]) => any>(
52
52
  func: F,
53
- options: { maxRetry: number; initialDuration?: number; growFactor?: number },
53
+ options?: { maxRetry?: number; initialDuration?: number; growFactor?: number },
54
54
  ) {
55
- let retries = options.maxRetry;
56
- let duration = options.initialDuration || 500;
57
- const growFactorFinal = options.growFactor || 2;
55
+ let retries = options?.maxRetry || 3;
56
+ let duration = options?.initialDuration || 500;
57
+ const growFactorFinal = options?.growFactor || 2;
58
58
 
59
59
  return async (...args: Parameters<F>): Promise<ReturnType<F>> => {
60
60
  do {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "Skynet Shared JS library",
5
5
  "type": "module",
6
6
  "main": "index.ts",