camoufox-js 0.9.3 → 0.10.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,13 +1,7 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
3
  import { OS_ARCH_MATRIX } from "../pkgman.js";
4
- // Cached Database constructor - loaded lazily on first use
5
4
  let DatabaseConstructor = null;
6
- /**
7
- * Opens a SQLite database using the appropriate driver for the runtime.
8
- * Uses bun:sqlite in Bun, better-sqlite3 in Node.js.
9
- * The Database constructor is cached after first load.
10
- */
11
5
  async function openDatabase(pathName) {
12
6
  if (!DatabaseConstructor) {
13
7
  if (typeof Bun !== "undefined") {
@@ -15,12 +9,15 @@ async function openDatabase(pathName) {
15
9
  const { Database: BunDatabase } = await import("bun:sqlite");
16
10
  DatabaseConstructor = BunDatabase;
17
11
  }
12
+ else if (typeof Deno !== "undefined") {
13
+ const { DatabaseSync } = await import("node:sqlite");
14
+ DatabaseConstructor = DatabaseSync;
15
+ }
18
16
  else {
19
- const { default: NodeDatabase } = await import("better-sqlite3");
20
- DatabaseConstructor = NodeDatabase;
17
+ const { default: BetterSqlite3 } = await import("better-sqlite3");
18
+ DatabaseConstructor = BetterSqlite3;
21
19
  }
22
20
  }
23
- // DatabaseConstructor is guaranteed to be set at this point
24
21
  return new DatabaseConstructor(pathName);
25
22
  }
26
23
  // Get database path relative to this file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "camoufox-js",
3
- "version": "0.9.3",
3
+ "version": "0.10.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -36,7 +36,7 @@
36
36
  "commander": "^14.0.0",
37
37
  "fingerprint-generator": "^2.1.66",
38
38
  "glob": "^13.0.0",
39
- "impit": "^0.11.0",
39
+ "impit": "^0.13.0",
40
40
  "language-tags": "^2.0.1",
41
41
  "maxmind": "^5.0.0",
42
42
  "pretty-bytes": "^7.1.0",
@@ -44,7 +44,7 @@
44
44
  "xml2js": "^0.6.2"
45
45
  },
46
46
  "devDependencies": {
47
- "@biomejs/biome": "2.4.8",
47
+ "@biomejs/biome": "2.4.10",
48
48
  "@types/adm-zip": "^0.5.7",
49
49
  "@types/better-sqlite3": "^7.6.13",
50
50
  "@types/cli-progress": "^3.11.6",