@dbcube/core 4.0.4 → 4.1.4

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/index.js CHANGED
@@ -131,6 +131,8 @@ import followRedirects from "follow-redirects";
131
131
  import * as unzipper from "unzipper";
132
132
  import ora from "ora";
133
133
  import chalk from "chalk";
134
+ import { fileURLToPath } from "url";
135
+ import { dirname } from "path";
134
136
  var { https } = followRedirects;
135
137
  var Downloader = class {
136
138
  static mainSpinner = null;
@@ -361,6 +363,8 @@ var Downloader = class {
361
363
  }
362
364
  }
363
365
  static getDefaultBinDir() {
366
+ const __filename2 = typeof import.meta !== "undefined" && import.meta.url ? fileURLToPath(import.meta.url) : "";
367
+ const __dirname = __filename2 ? dirname(__filename2) : process.cwd();
364
368
  const possibleDirs = [
365
369
  path.resolve(process.cwd(), ".dbcube", "bin"),
366
370
  path.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
@@ -389,6 +393,8 @@ var Downloader = class {
389
393
  import * as fs2 from "fs";
390
394
  import * as path2 from "path";
391
395
  import * as os3 from "os";
396
+ import { fileURLToPath as fileURLToPath2 } from "url";
397
+ import { dirname as dirname2 } from "path";
392
398
  var Binary = class {
393
399
  static isDownloading = false;
394
400
  static downloadPromise = null;
@@ -429,6 +435,8 @@ var Binary = class {
429
435
  }
430
436
  }
431
437
  static getBinDir() {
438
+ const __filename2 = typeof import.meta !== "undefined" && import.meta.url ? fileURLToPath2(import.meta.url) : "";
439
+ const __dirname = __filename2 ? dirname2(__filename2) : process.cwd();
432
440
  const possibleDirs = [
433
441
  path2.resolve(process.cwd(), ".dbcube", "bin"),
434
442
  path2.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
@@ -1291,6 +1299,8 @@ import * as path5 from "path";
1291
1299
  import * as fs3 from "fs";
1292
1300
  import { promisify } from "util";
1293
1301
  import { createRequire as createRequire3 } from "module";
1302
+ import { fileURLToPath as fileURLToPath3 } from "url";
1303
+ import { dirname as dirname3 } from "path";
1294
1304
  var execAsync = promisify(exec);
1295
1305
  var SqliteExecutor = class {
1296
1306
  binaryPath;
@@ -1300,6 +1310,8 @@ var SqliteExecutor = class {
1300
1310
  this.binaryPath = this.getBinaryPath();
1301
1311
  }
1302
1312
  getBinaryPath() {
1313
+ const __filename2 = typeof import.meta !== "undefined" && import.meta.url ? fileURLToPath3(import.meta.url) : "";
1314
+ const __dirname = __filename2 ? dirname3(__filename2) : process.cwd();
1303
1315
  const possibleDirs = [
1304
1316
  path5.resolve(process.cwd(), ".dbcube", "bin"),
1305
1317
  path5.resolve(process.cwd(), "node_modules", ".dbcube", "bin"),
@@ -1422,7 +1434,8 @@ var SqliteExecutor = class {
1422
1434
  }
1423
1435
  // Para compatibilidad con better-sqlite3 API sincrona usando deasync si es necesario
1424
1436
  prepareSync(sql) {
1425
- const requireUrl = typeof __filename !== "undefined" ? __filename : process.cwd();
1437
+ const __filename2 = typeof import.meta !== "undefined" && import.meta.url ? fileURLToPath3(import.meta.url) : "";
1438
+ const requireUrl = __filename2 || import.meta.url;
1426
1439
  const require2 = createRequire3(requireUrl);
1427
1440
  const deasync = require2("deasync");
1428
1441
  return {