zen-fs-config 0.3.9 → 0.3.10

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
@@ -349,9 +349,10 @@ async function wrapZenFSFileSystem(config) {
349
349
  },
350
350
  async stat(path, ..._args) {
351
351
  const st = await isolatedFS.stat(path);
352
+ const isDir = typeof st.isDirectory === "function" ? st.isDirectory() : st.mode !== void 0 && (st.mode & 61440) === 16384;
352
353
  return {
353
- isFile: () => st.isDirectory?.() === false || st.mode !== void 0 && (st.mode & 61440) === 32768,
354
- isDirectory: () => st.isDirectory?.() === true || st.mode !== void 0 && (st.mode & 61440) === 16384,
354
+ isFile: () => !isDir,
355
+ isDirectory: () => isDir,
355
356
  size: st.size,
356
357
  mtime: st.mtimeMs ?? st.mtime
357
358
  };
package/dist/index.mjs CHANGED
@@ -302,9 +302,10 @@ async function wrapZenFSFileSystem(config) {
302
302
  },
303
303
  async stat(path, ..._args) {
304
304
  const st = await isolatedFS.stat(path);
305
+ const isDir = typeof st.isDirectory === "function" ? st.isDirectory() : st.mode !== void 0 && (st.mode & 61440) === 16384;
305
306
  return {
306
- isFile: () => st.isDirectory?.() === false || st.mode !== void 0 && (st.mode & 61440) === 32768,
307
- isDirectory: () => st.isDirectory?.() === true || st.mode !== void 0 && (st.mode & 61440) === 16384,
307
+ isFile: () => !isDir,
308
+ isDirectory: () => isDir,
308
309
  size: st.size,
309
310
  mtime: st.mtimeMs ?? st.mtime
310
311
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
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",