fix: ignore macOS zip metadata entries

This commit is contained in:
yangkangkang 2026-06-08 11:30:52 +08:00
parent 49821e51cb
commit 5f38a7b827
1 changed files with 5 additions and 3 deletions

View File

@ -41,9 +41,11 @@ export async function createZip(files: File[]): Promise<Uint8Array> {
}
export function ignoreEntry(filename: string): boolean {
const segments = filename.split("/");
return (
filename.startsWith(".") ||
filename.includes("/__MACOSX/") ||
filename.endsWith("/")
filename.endsWith("/") ||
segments.some(
(segment) => segment === "__MACOSX" || segment.startsWith("."),
)
);
}