Skip to content

Commit

Permalink
Fix slight type issue
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 30, 2024
1 parent 2dc1360 commit bcc70c6
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,6 @@ import { S_IFDIR, S_IFREG } from '@zenfs/core/emulation/constants.js';
import { basename, dirname, join } from '@zenfs/core/emulation/path.js';
import { convertException, type ConvertException } from './utils.js';

declare global {
interface FileSystemDirectoryHandle {
[Symbol.iterator](): IterableIterator<[string, FileSystemHandle]>;
entries(): IterableIterator<[string, FileSystemHandle]>;
keys(): IterableIterator<string>;
values(): IterableIterator<FileSystemHandle>;
}
}

export interface WebAccessOptions {
handle: FileSystemDirectoryHandle;
}
Expand Down Expand Up @@ -169,7 +160,11 @@ export class WebAccessFS extends Async(FileSystem) {
throw ErrnoError.With('ENOTDIR', path, 'readdir');
}

return Array.from(handle.keys());
const entries = [];
for await (const k of handle.keys()) {
entries.push(k);
}
return entries;
}

protected async getHandle(path: string): Promise<FileSystemHandle> {
Expand Down

0 comments on commit bcc70c6

Please sign in to comment.