sliftutils 1.1.46 → 1.1.48

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
@@ -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;
@@ -813,10 +817,7 @@ declare module "sliftutils/storage/BulkDatabase2/BulkDatabase2" {
813
817
  private baseFieldsLoading;
814
818
  private ensureBaseColumn;
815
819
  private ensureBaseField;
816
- getSingleFieldSync<Column extends keyof T>(config: {
817
- key: string;
818
- column: Column;
819
- }): T[Column] | undefined;
820
+ getSingleFieldSync<Column extends keyof T>(key: string, column: Column): T[Column] | undefined;
820
821
  getColumnSync<Column extends keyof T>(column: Column): {
821
822
  key: string;
822
823
  value: T[Column];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sliftutils",
3
- "version": "1.1.46",
3
+ "version": "1.1.48",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -51,7 +51,7 @@
51
51
  "mobx": "^6.13.3",
52
52
  "preact-old-types": "^10.28.1",
53
53
  "shell-quote": "^1.8.3",
54
- "socket-function": "^1.1.38",
54
+ "socket-function": "^1.1.40",
55
55
  "typenode": "*",
56
56
  "typesafecss": "*",
57
57
  "ws": "^8.18.3",
@@ -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;
@@ -48,10 +52,7 @@ export declare class BulkDatabase2<T extends {
48
52
  private baseFieldsLoading;
49
53
  private ensureBaseColumn;
50
54
  private ensureBaseField;
51
- getSingleFieldSync<Column extends keyof T>(config: {
52
- key: string;
53
- column: Column;
54
- }): T[Column] | undefined;
55
+ getSingleFieldSync<Column extends keyof T>(key: string, column: Column): T[Column] | undefined;
55
56
  getColumnSync<Column extends keyof T>(column: Column): {
56
57
  key: string;
57
58
  value: T[Column];
@@ -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.
@@ -627,10 +627,9 @@ export class BulkDatabase2<T extends { key: string }> {
627
627
  })();
628
628
  }
629
629
 
630
- public getSingleFieldSync<Column extends keyof T>(config: { key: string; column: Column }): T[Column] | undefined {
630
+ public getSingleFieldSync<Column extends keyof T>(key: string, column: Column): T[Column] | undefined {
631
631
  void this.syncSetup();
632
632
  this.loadVersion.get();
633
- let { key, column } = config;
634
633
  let col = String(column);
635
634
  let entry = this.overlay.get(key);
636
635
  if (entry !== undefined) {
package/yarn.lock CHANGED
@@ -1940,10 +1940,10 @@ slash@^3.0.0:
1940
1940
  resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
1941
1941
  integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
1942
1942
 
1943
- socket-function@^1.1.38:
1944
- version "1.1.38"
1945
- resolved "https://registry.yarnpkg.com/socket-function/-/socket-function-1.1.38.tgz#8923a1db19480d5828d9bde9975eabac505698ce"
1946
- integrity sha512-LJFeVUaXT8D8egyKr7fZajq7ctmLUN58Uih6GHx3/pfXV3pDFfJS0+XJRqsk0udn0II1ZqozEz242khs4fLCKQ==
1943
+ socket-function@^1.1.40:
1944
+ version "1.1.40"
1945
+ resolved "https://registry.yarnpkg.com/socket-function/-/socket-function-1.1.40.tgz#0994aa018b3fcc64a131d29e5926377b7baff280"
1946
+ integrity sha512-PtU8csq90nbjM/Jr/irRHzj2PojUgcMXTctfBMDEHJrLKmeOM4flf87svn0M8ad5iwNiSyav8SdxCzCl9IwZJw==
1947
1947
  dependencies:
1948
1948
  "@types/pako" "^2.0.3"
1949
1949
  "@types/ws" "^8.5.3"