Features/shadcn #1
@@ -58,6 +58,18 @@ const isImage = (path: string) => IMAGE_EXTENSIONS.has(getExtension(path));
|
||||
|
||||
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 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)) {
|
||||
const baseName = getBaseName(path);
|
||||
|
||||
if (isMacMetadataEntry(path)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (baseName.toLowerCase() === ZIP_META_FILE_NAME) {
|
||||
xjustizNachrichtXml = data;
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user