@zenfs/core 0.16.2 → 0.16.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/config.js CHANGED
@@ -41,9 +41,7 @@ export async function resolveMountConfig(config, _depth = 0) {
41
41
  }
42
42
  await checkOptions(backend, config);
43
43
  const mount = (await backend.create(config));
44
- if ('_disableSync' in mount) {
45
- mount._disableSync = config.disableAsyncCache || false;
46
- }
44
+ mount._disableSync = config.disableAsyncCache || false;
47
45
  await mount.ready();
48
46
  return mount;
49
47
  }
@@ -876,7 +876,7 @@ export async function rm(path, options) {
876
876
  case constants.S_IFDIR:
877
877
  if (options?.recursive) {
878
878
  for (const entry of await readdir(path)) {
879
- await rm(join(path, entry));
879
+ await rm(join(path, entry), options);
880
880
  }
881
881
  }
882
882
  await rmdir(path);
@@ -648,7 +648,7 @@ export function rmSync(path, options) {
648
648
  case S_IFDIR:
649
649
  if (options?.recursive) {
650
650
  for (const entry of readdirSync(path)) {
651
- rmSync(join(path, entry));
651
+ rmSync(join(path, entry), options);
652
652
  }
653
653
  }
654
654
  rmdirSync(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/core",
3
- "version": "0.16.2",
3
+ "version": "0.16.4",
4
4
  "description": "A filesystem, anywhere",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/scripts/build.js CHANGED
@@ -62,9 +62,7 @@ const config = {
62
62
  onStart(start);
63
63
 
64
64
  if (watch && !quiet) {
65
- onEnd(() => {
66
- console.log(`--------------- Built #${buildCount}`);
67
- });
65
+ onEnd(() => console.log(`--------------- Built #${buildCount}`));
68
66
  }
69
67
  },
70
68
  },
package/src/config.ts CHANGED
@@ -4,7 +4,7 @@ import * as fs from './emulation/index.js';
4
4
  import type { AbsolutePath } from './emulation/path.js';
5
5
  import { setCred, type MountObject } from './emulation/shared.js';
6
6
  import { Errno, ErrnoError } from './error.js';
7
- import { FileSystem, type Async } from './filesystem.js';
7
+ import { FileSystem } from './filesystem.js';
8
8
 
9
9
  /**
10
10
  * Configuration for a specific mount point
@@ -59,10 +59,7 @@ export async function resolveMountConfig<T extends Backend>(config: MountConfigu
59
59
  }
60
60
  await checkOptions(backend, config);
61
61
  const mount = (await backend.create(config)) as FilesystemOf<T>;
62
- if ('_disableSync' in mount) {
63
- type AsyncFS = InstanceType<ReturnType<typeof Async<new () => FilesystemOf<T>>>>;
64
- (mount as AsyncFS)._disableSync = config.disableAsyncCache || false;
65
- }
62
+ mount._disableSync = config.disableAsyncCache || false;
66
63
  await mount.ready();
67
64
  return mount;
68
65
  }
@@ -514,7 +514,7 @@ async function _open(path: fs.PathLike, _flag: fs.OpenMode, _mode: fs.Mode = 0o6
514
514
  return new FileHandle(await fs.openFile(resolved, flag, cred));
515
515
  }
516
516
 
517
- /*
517
+ /*
518
518
  In a previous implementation, we deleted the file and
519
519
  re-created it. However, this created a race condition if another
520
520
  asynchronous request was trying to read the file, as the file
@@ -907,7 +907,7 @@ export async function rm(path: fs.PathLike, options?: fs.RmOptions) {
907
907
  case constants.S_IFDIR:
908
908
  if (options?.recursive) {
909
909
  for (const entry of await readdir(path)) {
910
- await rm(join(path, entry));
910
+ await rm(join(path, entry), options);
911
911
  }
912
912
  }
913
913
 
@@ -731,7 +731,7 @@ export function rmSync(path: fs.PathLike, options?: fs.RmOptions): void {
731
731
  case S_IFDIR:
732
732
  if (options?.recursive) {
733
733
  for (const entry of readdirSync(path)) {
734
- rmSync(join(path, entry));
734
+ rmSync(join(path, entry), options);
735
735
  }
736
736
  }
737
737