still working on saving files

This commit is contained in:
Chris Kruining 2024-10-22 16:31:52 +02:00
parent e363ee1844
commit c96348e888
No known key found for this signature in database
GPG key ID: EB894A3560CCCAD2
6 changed files with 67 additions and 54 deletions

View file

@ -11,6 +11,8 @@ export interface FileEntry {
id: string;
kind: 'file';
meta: File;
handle: FileSystemFileHandle;
directory: FileSystemDirectoryHandle;
}
export interface FolderEntry {
@ -37,7 +39,7 @@ export async function* walk(directory: FileSystemDirectoryHandle, filters: RegEx
const id = await handle.getUniqueId();
if (handle.kind === 'file') {
yield { name: handle.name, id, kind: 'file', meta: await handle.getFile() };
yield { name: handle.name, id, kind: 'file', meta: await handle.getFile(), handle, directory };
}
else {
yield { name: handle.name, id, kind: 'folder', entries: await Array.fromAsync(walk(handle, filters, depth + 1)) };