sliftutils 1.1.45 → 1.1.47

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.
@@ -4,7 +4,8 @@
4
4
  "WebFetch(domain:openrouter.ai)",
5
5
  "Bash(git pull *)",
6
6
  "Bash(echo \"---EXIT:$?---\")",
7
- "Bash(yarn publish *)"
7
+ "Bash(yarn publish *)",
8
+ "Bash(git push *)"
8
9
  ]
9
10
  }
10
11
  }
package/index.d.ts CHANGED
@@ -769,7 +769,11 @@ declare module "sliftutils/storage/BulkDatabase2/BulkDatabase2" {
769
769
  readonly name: string;
770
770
  constructor(name: string);
771
771
  static clearCache(): void;
772
- private storage;
772
+ storage: {
773
+ (): Promise<import("../FileFolderAPI").FileStorage>;
774
+ reset(): void;
775
+ set(newValue: Promise<import("../FileFolderAPI").FileStorage>): void;
776
+ };
773
777
  private overlay;
774
778
  private streamTimes;
775
779
  private loadVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "1.1.45",
3
+ "version": "1.1.47",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -4,7 +4,11 @@ export declare class BulkDatabase2<T extends {
4
4
  readonly name: string;
5
5
  constructor(name: string);
6
6
  static clearCache(): void;
7
- private storage;
7
+ storage: {
8
+ (): Promise<import("../FileFolderAPI").FileStorage>;
9
+ reset(): void;
10
+ set(newValue: Promise<import("../FileFolderAPI").FileStorage>): void;
11
+ };
8
12
  private overlay;
9
13
  private streamTimes;
10
14
  private loadVersion;
@@ -96,7 +96,7 @@ export class BulkDatabase2<T extends { key: string }> {
96
96
  blockCache.clear();
97
97
  }
98
98
 
99
- private storage = lazy(async () => getFileStorageNested2(`${BULK_ROOT_FOLDER}/${this.name}`));
99
+ public storage = lazy(async () => getFileStorageNested2(`${BULK_ROOT_FOLDER}/${this.name}`));
100
100
 
101
101
  // In-memory overlay of pending writes/deletes, observable so reads re-render when it changes. It
102
102
  // takes priority over the loaded readers, so writes are reflected in reads without reloading.
@@ -13,7 +13,11 @@ const subscribers = new Map<string, ((write: RemoteWrite) => void)[]>();
13
13
  const recentResolvers = new Map<string, ((writes: RemoteWrite[]) => void)[]>();
14
14
 
15
15
  export function isSyncSupported(): boolean {
16
- return typeof SharedWorker !== "undefined";
16
+ if (typeof SharedWorker === "undefined") return false;
17
+ // Under file:// the SharedWorker constructor throws a SecurityError (cross-origin / opaque
18
+ // origin), so skip it rather than logging that error on every load.
19
+ if (typeof location !== "undefined" && location.protocol === "file:") return false;
20
+ return true;
17
21
  }
18
22
 
19
23
  function ensure() {