Give files map a proper type
Alan Pearce alan@alanpearce.eu
Tue, 12 Sep 2023 17:16:58 +0200
1 files changed, 7 insertions(+), 1 deletions(-)
jump to
M src/index.ts → src/index.ts
@@ -18,7 +18,13 @@ function getFilename(name: string): string { return path.join(publicDir, `${name}`); } -let files: Map<string, any> = new Map(); +type File = { + filename: string; + size: number; + mtime: string; +}; + +let files = new Map<string, File>(); function registerFile(pathname: string, absPath: string, stat: Stats): void { pathname = "/" + (pathname === "." || pathname === "./" ? "" : pathname);