Skip to content

Commit

Permalink
new ts version gang
Browse files Browse the repository at this point in the history
  • Loading branch information
GregTCLTK committed Mar 28, 2024
1 parent 37cb634 commit 281c1b6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 2 additions & 2 deletions deno.jsonc
Expand Up @@ -2,7 +2,7 @@
"imports": {
"webgen/": "https://raw.githubusercontent.com/lucsoft/WebGen/e7cdd13/",
// "webgen/": "../WebGen/",
"std/": "https://deno.land/std@0.220.0/",
"std/": "https://deno.land/std@0.221.0/",
"shared/": "./pages/shared/"
},
"lock": false,
Expand Down Expand Up @@ -33,4 +33,4 @@
"proseWrap": "never",
"lineWidth": 300
}
}
}
9 changes: 1 addition & 8 deletions pages/shared/fileHandler.ts
Expand Up @@ -5,13 +5,6 @@ export interface FileEntry {
file: File;
}

//should be fixed in next TS version
declare global {
interface FileSystemDirectoryHandle {
values: () => ReadableStream<FileSystemDirectoryHandle | FileSystemFileHandle>;
}
}

async function* walkFileTree(handle: FileSystemHandle, path?: string): AsyncGenerator<FileEntry> {
const realpath = path ?? `${handle.name}`;
if (handle.kind === "file") {
Expand All @@ -23,7 +16,7 @@ async function* walkFileTree(handle: FileSystemHandle, path?: string): AsyncGene
const entryPath = `${realpath}/${entry.name}`;

if (entry.kind == "file") {
const file = await entry.getFile();
const file = await (<FileSystemFileHandle> entry).getFile();
yield { path: entryPath, file };
} else if (entry.kind == "directory") {
yield* walkFileTree(entry, entryPath);
Expand Down

0 comments on commit 281c1b6

Please sign in to comment.