@wxn0brp/db 0.9.0 → 0.9.1

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.
@@ -1,6 +1,7 @@
1
1
  import { existsSync, mkdirSync, promises, statSync } from "fs";
2
2
  import dbActionBase from "../base/actions.js";
3
3
  import gen from "../helpers/gen.js";
4
+ import { resolve, sep } from "path";
4
5
  /**
5
6
  * A class representing database actions on files.
6
7
  * @class
@@ -37,9 +38,11 @@ class dbActionC extends dbActionBase {
37
38
  const collections = allCollections
38
39
  .filter(dirent => dirent.isDirectory())
39
40
  .map(dirent => {
40
- if (dirent.parentPath === this.folder)
41
+ const parentPath = resolve(dirent.parentPath);
42
+ const baseFolder = resolve(this.folder);
43
+ if (parentPath === baseFolder)
41
44
  return dirent.name;
42
- return dirent.parentPath.replace(this.folder + "/", "") + "/" + dirent.name;
45
+ return parentPath.replace(baseFolder + sep, "") + "/" + dirent.name;
43
46
  });
44
47
  return collections;
45
48
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = "0.9.0";
1
+ export const version = "0.9.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wxn0brp/db",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "A simple file-based database management system with support for CRUD operations, custom queries, and graph structures.",