@wxn0brp/db-core 0.10.1 → 0.10.2

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/db/memory.js CHANGED
@@ -22,8 +22,8 @@ export class MemoryAction extends CustomActionsBase {
22
22
  return collections;
23
23
  }
24
24
  async ensureCollection(collection) {
25
- if (this.issetCollection(collection))
26
- return;
25
+ if (this.memory.has(collection))
26
+ return false;
27
27
  this.memory.set(collection, []);
28
28
  return true;
29
29
  }
@@ -31,6 +31,8 @@ export class MemoryAction extends CustomActionsBase {
31
31
  return this.memory.has(collection);
32
32
  }
33
33
  async removeCollection(collection) {
34
+ if (!this.memory.has(collection))
35
+ return false;
34
36
  this.memory.delete(collection);
35
37
  return true;
36
38
  }
@@ -21,7 +21,7 @@ export declare class ValtheraClass implements ValtheraCompatible {
21
21
  version: string;
22
22
  constructor(options: DbOpts);
23
23
  init(...args: any[]): Promise<unknown>;
24
- execute<T>(name: keyof ValtheraCompatible, query: VQuery<any>): Promise<T>;
24
+ execute<T>(name: keyof ValtheraCompatible, query: VQuery<any> | string): Promise<T>;
25
25
  /**
26
26
  * Create a new instance of a CollectionManager class.
27
27
  */
@@ -50,13 +50,13 @@ export class ValtheraClass {
50
50
  * Check and create the specified collection if it doesn't exist.
51
51
  */
52
52
  async ensureCollection(collection) {
53
- return await this.execute("ensureCollection", { collection });
53
+ return await this.execute("ensureCollection", collection);
54
54
  }
55
55
  /**
56
56
  * Check if a collection exists.
57
57
  */
58
58
  async issetCollection(collection) {
59
- return await this.execute("issetCollection", { collection });
59
+ return await this.execute("issetCollection", collection);
60
60
  }
61
61
  /**
62
62
  * Add data to a database.
@@ -144,6 +144,6 @@ export class ValtheraClass {
144
144
  * Removes a database collection from the file system.
145
145
  */
146
146
  removeCollection(collection) {
147
- return this.execute("removeCollection", { collection });
147
+ return this.execute("removeCollection", collection);
148
148
  }
149
149
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "0.10.1";
1
+ export const version = "0.10.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/db-core",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.js",
6
6
  "author": "wxn0brP",
@@ -18,8 +18,8 @@
18
18
  "devDependencies": {
19
19
  "@types/bun": "*",
20
20
  "@types/node": "*",
21
- "tsc-alias": "*",
22
- "typescript": "*"
21
+ "tsc-alias": "^1",
22
+ "typescript": "^6"
23
23
  },
24
24
  "files": [
25
25
  "dist"