sliftutils 0.70.0 → 0.71.0

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
@@ -49,6 +49,11 @@ declare module "sliftutils/misc/getSecret" {
49
49
 
50
50
  }
51
51
 
52
+ declare module "sliftutils/misc/helpers" {
53
+ export declare function waitForDiskCollectionFlush(): Promise<void>;
54
+
55
+ }
56
+
52
57
  declare module "sliftutils/misc/matchFilter" {
53
58
  export declare function matchFilter(filter: {
54
59
  value: string;
@@ -0,0 +1 @@
1
+ export declare function waitForDiskCollectionFlush(): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import { delay } from "socket-function/src/batching";
2
+ import { hasPending } from "../storage/PendingManager";
3
+
4
+ export async function waitForDiskCollectionFlush() {
5
+ await delay(2000);
6
+ while (hasPending()) {
7
+ console.log("Waiting for pending operations to complete...");
8
+ await delay(2000);
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "0.70.0",
3
+ "version": "0.71.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [