socket-function 1.1.44 → 1.1.45

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/index.d.ts CHANGED
@@ -1133,7 +1133,7 @@ declare module "socket-function/src/misc" {
1133
1133
  export declare function timeoutToUndefined<T>(time: number, p: Promise<T>): Promise<T | undefined>;
1134
1134
  export declare function timeoutToUndefinedSilent<T>(time: number, p: Promise<T>): Promise<T | undefined>;
1135
1135
  export declare function errorToWarning<T>(promise: Promise<T>): void;
1136
- export declare function watchSlowPromise<T>(title: string, promise: Promise<T>, config: {
1136
+ export declare function watchSlowPromise<T>(title: string, promise: Promise<T>, config?: {
1137
1137
  interval?: number;
1138
1138
  }): Promise<T>;
1139
1139
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "1.1.44",
3
+ "version": "1.1.45",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
package/src/misc.d.ts CHANGED
@@ -96,6 +96,6 @@ export declare function timeoutToError<T>(time: number, p: Promise<T>, err: () =
96
96
  export declare function timeoutToUndefined<T>(time: number, p: Promise<T>): Promise<T | undefined>;
97
97
  export declare function timeoutToUndefinedSilent<T>(time: number, p: Promise<T>): Promise<T | undefined>;
98
98
  export declare function errorToWarning<T>(promise: Promise<T>): void;
99
- export declare function watchSlowPromise<T>(title: string, promise: Promise<T>, config: {
99
+ export declare function watchSlowPromise<T>(title: string, promise: Promise<T>, config?: {
100
100
  interval?: number;
101
101
  }): Promise<T>;
package/src/misc.ts CHANGED
@@ -461,10 +461,10 @@ export function errorToWarning<T>(promise: Promise<T>): void {
461
461
  }) as any;
462
462
  }
463
463
 
464
- export function watchSlowPromise<T>(title: string, promise: Promise<T>, config: {
464
+ export function watchSlowPromise<T>(title: string, promise: Promise<T>, config?: {
465
465
  interval?: number;
466
466
  }) {
467
- let { interval = 5000 } = config;
467
+ let { interval = 5000 } = config || {};
468
468
  let fulfilled = false;
469
469
  void promise.finally(() => fulfilled = true);
470
470
  let startTime = Date.now();