Use strict type checking

This commit is contained in:
Hornwitser committed 2023-08-12 02:31:17 +02:00
1 parent 2ca8e69025
commit a66e930997
36 files changed
+714 -676

No files matched your search

+2 -2
View File
@@ -46,7 +46,7 @@ export async function directorySize(directory: string) {
let dirEntries: fs.Dirent[];
try {
dirEntries = await fs.readdir(directory, { withFileTypes: true });
} catch (err) {
} catch (err: any) {
if (err.code === "ENOENT") {
return 0;
}
@@ -92,7 +92,7 @@ export async function findUnusedName(directory: string, name: string, extension
return `${name}${extension}`;
}
let match = /^(.*?)(-(\d+))?$/.exec(name);
let match = /^(.*?)(-(\d+))?$/.exec(name)!;
if (!match[2]) {
name = `${match[1]}-2`;
} else {