@wxn0brp/db-storage-web 0.90.0 → 0.110.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/dist/storage.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { CustomActionsBase } from "@wxn0brp/db-core/base/custom";
2
- import { VQuery } from "@wxn0brp/db-core/types/query";
3
2
  export declare class WebStorageActions extends CustomActionsBase {
4
3
  name: string;
5
4
  private storage;
@@ -7,8 +6,8 @@ export declare class WebStorageActions extends CustomActionsBase {
7
6
  _getPath(collection: string): string;
8
7
  _read(collection: string): any;
9
8
  _write(collection: string, data: object[]): void;
10
- ensureCollection(config: VQuery): Promise<boolean>;
11
- issetCollection(config: VQuery): Promise<boolean>;
9
+ ensureCollection(collection: string): Promise<boolean>;
10
+ issetCollection(collection: string): Promise<boolean>;
12
11
  getCollections(): Promise<string[]>;
13
- removeCollection(config: VQuery): Promise<boolean>;
12
+ removeCollection(collection: string): Promise<boolean>;
14
13
  }
package/dist/storage.js CHANGED
@@ -19,14 +19,14 @@ export class WebStorageActions extends CustomActionsBase {
19
19
  _write(collection, data) {
20
20
  this.storage.setItem(this._getPath(collection), JSON.stringify(data));
21
21
  }
22
- async ensureCollection(config) {
23
- const key = this._getPath(config.collection);
22
+ async ensureCollection(collection) {
23
+ const key = this._getPath(collection);
24
24
  if (!this.storage.getItem(key))
25
25
  this.storage.setItem(key, JSON.stringify([]));
26
26
  return true;
27
27
  }
28
- async issetCollection(config) {
29
- return !!this.storage.getItem(this._getPath(config.collection));
28
+ async issetCollection(collection) {
29
+ return !!this.storage.getItem(this._getPath(collection));
30
30
  }
31
31
  async getCollections() {
32
32
  const keys = [];
@@ -38,8 +38,8 @@ export class WebStorageActions extends CustomActionsBase {
38
38
  }
39
39
  return keys;
40
40
  }
41
- async removeCollection(config) {
42
- this.storage.removeItem(this._getPath(config.collection));
41
+ async removeCollection(collection) {
42
+ this.storage.removeItem(this._getPath(collection));
43
43
  return true;
44
44
  }
45
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/db-storage-web",
3
- "version": "0.90.0",
3
+ "version": "0.110.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "author": "wxn0brP",
@@ -18,12 +18,12 @@
18
18
  "vdb-adapter"
19
19
  ],
20
20
  "peerDependencies": {
21
- "@wxn0brp/db-core": "~0.9.0"
21
+ "@wxn0brp/db-core": "^0.11.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@wxn0brp/db-core": "~0.9.0",
25
- "tsc-alias": "*",
26
- "typescript": "*"
24
+ "@wxn0brp/db-core": "^0.11.0",
25
+ "tsc-alias": "^1",
26
+ "typescript": "^6"
27
27
  },
28
28
  "files": [
29
29
  "dist"
package/dist/version.js DELETED
@@ -1 +0,0 @@
1
- export const version = "0.90.0";