Skip to content

Commit

Permalink
Function should not throw
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed Oct 8, 2023
1 parent 8c5029c commit 5470f32
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ export async function createArchiveByFileStat(
path: string,
options: Readonly<ICreateArchiveOptions> | null = null
) {
const st = await stat(path);
return st.isDirectory()
const st = await stat(path).catch(() => null);
return st?.isDirectory()
? new ArchiveDir(path)
: createArchiveByFileExtension(path, options);
}

0 comments on commit 5470f32

Please sign in to comment.