@zenfs/dom 1.2.2 → 1.2.3

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/access.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CreationOptions, FileSystem, InodeLike } from '@zenfs/core';
1
+ import type { FileSystem } from '@zenfs/core';
2
2
  import { IndexFS, Inode } from '@zenfs/core';
3
3
  export interface WebAccessOptions {
4
4
  handle: FileSystemDirectoryHandle;
@@ -50,7 +50,7 @@ export declare class WebAccessFS extends WebAccessFS_base {
50
50
  * @deprecated @internal @hidden
51
51
  */
52
52
  writeFile(path: string, data: Uint8Array): Promise<void>;
53
- mkdir(path: string, options: CreationOptions): Promise<InodeLike>;
53
+ _mkdir(path: string): Promise<void>;
54
54
  protected get<const T extends FileSystemHandleKind | null>(kind: T | undefined, path: string): Promise<HKindToType<T>>;
55
55
  }
56
56
  declare const _WebAccess: {
package/dist/access.js CHANGED
@@ -113,6 +113,10 @@ export class WebAccessFS extends Async(IndexFS) {
113
113
  }
114
114
  async remove(path) {
115
115
  const handle = await this.get('directory', dirname(path));
116
+ for (const p of this._handles.keys())
117
+ if (dirname(p) == path)
118
+ this._handles.delete(p);
119
+ this._handles.delete(path);
116
120
  await handle.removeEntry(basename(path), { recursive: true }).catch(ex => _throw(convertException(ex, path)));
117
121
  }
118
122
  removeSync() {
@@ -178,13 +182,11 @@ export class WebAccessFS extends Async(IndexFS) {
178
182
  async writeFile(path, data) {
179
183
  return this.write(path, data, 0);
180
184
  }
181
- async mkdir(path, options) {
182
- const inode = await super.mkdir(path, options);
185
+ async _mkdir(path) {
183
186
  const handle = await this.get('directory', dirname(path));
184
187
  const dir = await handle.getDirectoryHandle(basename(path), { create: true }).catch((ex) => _throw(convertException(ex, path)));
185
188
  if (!this.disableHandleCache)
186
189
  this._handles.set(path, dir);
187
- return inode;
188
190
  }
189
191
  async get(kind = null, path) {
190
192
  const maybeHandle = this._handles.get(path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenfs/dom",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "DOM backends for ZenFS",
5
5
  "funding": {
6
6
  "type": "individual",
@@ -61,7 +61,7 @@
61
61
  "typescript-eslint": "^8.8.1"
62
62
  },
63
63
  "peerDependencies": {
64
- "@zenfs/core": "^2.1.0",
64
+ "@zenfs/core": "^2.3.11",
65
65
  "kerium": "^1.3.4",
66
66
  "utilium": "^2.0.0"
67
67
  },