zen-fs-config 0.5.17 → 0.5.19

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
@@ -970,18 +970,28 @@ var ConfigRepo = class {
970
970
  */
971
971
  async safeExists(fs, path) {
972
972
  try {
973
- if (typeof fs.exists === "function") {
974
- console.log(`[TOMB-TRACE] safeExists: calling fs.exists(${path})`);
973
+ const ctorName = fs?.constructor?.name ?? typeof fs;
974
+ const hasExists = typeof fs?.exists === "function";
975
+ const hasStat = typeof fs?.stat === "function";
976
+ const innerBackend = fs?.inner?.constructor?.name;
977
+ const innerBackendName = fs?.inner?.backendName;
978
+ const directBackendName = fs?.backendName;
979
+ const backendLabel = innerBackendName ?? directBackendName ?? innerBackend ?? ctorName;
980
+ console.log(`[TOMB-TRACE] safeExists(${path}): fs type=${ctorName} backend=${backendLabel} hasExists=${hasExists} hasStat=${hasStat} inner=${innerBackend ?? "N/A"}`);
981
+ if (hasExists) {
982
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2192 calling fs.exists() [backend=${backendLabel}]`);
975
983
  const result = await fs.exists(path);
976
- console.log(`[TOMB-TRACE] safeExists: fs.exists(${path}) \u2192 ${result}`);
984
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2190 fs.exists() [backend=${backendLabel}] \u2192 ${result}`);
977
985
  return result;
978
986
  }
979
- console.log(`[TOMB-TRACE] safeExists: no exists(), calling fs.stat(${path})`);
987
+ console.log(`[TOMB-TRACE] safeExists(${path}): no exists(), calling fs.stat() [backend=${backendLabel}]`);
980
988
  await fs.stat(path);
981
- console.log(`[TOMB-TRACE] safeExists: fs.stat(${path}) \u2192 OK (exists)`);
989
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2190 fs.stat() [backend=${backendLabel}] \u2192 OK (exists)`);
982
990
  return true;
983
991
  } catch (err) {
984
- console.log(`[TOMB-TRACE] safeExists(${path}): threw ${err?.code ?? err?.status ?? ""} ${err?.message ?? err}`);
992
+ const errCode = err?.code ?? err?.status ?? "";
993
+ const errName = err?.constructor?.name ?? "";
994
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2190 ERROR ${errName} ${errCode} ${err?.message ?? err}`);
985
995
  return false;
986
996
  }
987
997
  }
package/dist/index.mjs CHANGED
@@ -880,18 +880,28 @@ var ConfigRepo = class {
880
880
  */
881
881
  async safeExists(fs, path) {
882
882
  try {
883
- if (typeof fs.exists === "function") {
884
- console.log(`[TOMB-TRACE] safeExists: calling fs.exists(${path})`);
883
+ const ctorName = fs?.constructor?.name ?? typeof fs;
884
+ const hasExists = typeof fs?.exists === "function";
885
+ const hasStat = typeof fs?.stat === "function";
886
+ const innerBackend = fs?.inner?.constructor?.name;
887
+ const innerBackendName = fs?.inner?.backendName;
888
+ const directBackendName = fs?.backendName;
889
+ const backendLabel = innerBackendName ?? directBackendName ?? innerBackend ?? ctorName;
890
+ console.log(`[TOMB-TRACE] safeExists(${path}): fs type=${ctorName} backend=${backendLabel} hasExists=${hasExists} hasStat=${hasStat} inner=${innerBackend ?? "N/A"}`);
891
+ if (hasExists) {
892
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2192 calling fs.exists() [backend=${backendLabel}]`);
885
893
  const result = await fs.exists(path);
886
- console.log(`[TOMB-TRACE] safeExists: fs.exists(${path}) \u2192 ${result}`);
894
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2190 fs.exists() [backend=${backendLabel}] \u2192 ${result}`);
887
895
  return result;
888
896
  }
889
- console.log(`[TOMB-TRACE] safeExists: no exists(), calling fs.stat(${path})`);
897
+ console.log(`[TOMB-TRACE] safeExists(${path}): no exists(), calling fs.stat() [backend=${backendLabel}]`);
890
898
  await fs.stat(path);
891
- console.log(`[TOMB-TRACE] safeExists: fs.stat(${path}) \u2192 OK (exists)`);
899
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2190 fs.stat() [backend=${backendLabel}] \u2192 OK (exists)`);
892
900
  return true;
893
901
  } catch (err) {
894
- console.log(`[TOMB-TRACE] safeExists(${path}): threw ${err?.code ?? err?.status ?? ""} ${err?.message ?? err}`);
902
+ const errCode = err?.code ?? err?.status ?? "";
903
+ const errName = err?.constructor?.name ?? "";
904
+ console.log(`[TOMB-TRACE] safeExists(${path}): \u2190 ERROR ${errName} ${errCode} ${err?.message ?? err}`);
895
905
  return false;
896
906
  }
897
907
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.5.17",
3
+ "version": "0.5.19",
4
4
  "description": "Distributed config management library built on ZenFS, zen-fs-cache, and zen-fs-sync",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -61,6 +61,6 @@
61
61
  "typescript": "^5.9.3",
62
62
  "vitest": "^1.6.1",
63
63
  "zen-fs-cache": "^1.0.1",
64
- "zen-fs-sync": "^0.4.7"
64
+ "zen-fs-sync": "^0.4.9"
65
65
  }
66
66
  }