ignores mac special folders
This commit is contained in:
@@ -58,6 +58,18 @@ const isImage = (path: string) => IMAGE_EXTENSIONS.has(getExtension(path));
|
|||||||
|
|
||||||
const normalizeKey = (value: string) => value.replaceAll("\\", "/").toLowerCase().trim();
|
const normalizeKey = (value: string) => value.replaceAll("\\", "/").toLowerCase().trim();
|
||||||
|
|
||||||
|
const isMacMetadataEntry = (path: string) => {
|
||||||
|
const normalizedPath = normalizeKey(path);
|
||||||
|
const baseName = getBaseName(normalizedPath);
|
||||||
|
|
||||||
|
return (
|
||||||
|
normalizedPath.startsWith("__macosx/") ||
|
||||||
|
normalizedPath.includes("/__macosx/") ||
|
||||||
|
baseName === ".ds_store" ||
|
||||||
|
baseName.startsWith("._")
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const matchesElementName = (element: Element, requestedName: string) => {
|
const matchesElementName = (element: Element, requestedName: string) => {
|
||||||
const requestedLocalName = requestedName.split(".").pop() ?? requestedName;
|
const requestedLocalName = requestedName.split(".").pop() ?? requestedName;
|
||||||
|
|
||||||
@@ -186,6 +198,10 @@ export const extractZipArchive = async (file: File): Promise<ProcessedZipArchive
|
|||||||
for (const [path, data] of Object.entries(files)) {
|
for (const [path, data] of Object.entries(files)) {
|
||||||
const baseName = getBaseName(path);
|
const baseName = getBaseName(path);
|
||||||
|
|
||||||
|
if (isMacMetadataEntry(path)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (baseName.toLowerCase() === ZIP_META_FILE_NAME) {
|
if (baseName.toLowerCase() === ZIP_META_FILE_NAME) {
|
||||||
xjustizNachrichtXml = data;
|
xjustizNachrichtXml = data;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user