Group zip extensions better
Some checks are pending
Tests / tests (push) Waiting to run

This commit is contained in:
Dustin Brett
2025-02-08 09:29:39 -08:00
parent 431da127f5
commit 8acad146c4
4 changed files with 7 additions and 4 deletions

View File

@@ -38,7 +38,6 @@ export const EXTRACTABLE_EXTENSIONS = new Set([
".odt", ".odt",
".ova", ".ova",
".pages", ".pages",
".pk3",
".pkg", ".pkg",
".ppt", ".ppt",
".qcow", ".qcow",

View File

@@ -38,6 +38,7 @@ import {
SHORTCUT_APPEND, SHORTCUT_APPEND,
SHORTCUT_EXTENSION, SHORTCUT_EXTENSION,
SYSTEM_SHORTCUT_DIRECTORIES, SYSTEM_SHORTCUT_DIRECTORIES,
ZIP_EXTENSIONS,
} from "utils/constants"; } from "utils/constants";
import { import {
bufferToUrl, bufferToUrl,
@@ -493,7 +494,7 @@ const useFolder = (
try { try {
const unzippedFiles = Object.entries( const unzippedFiles = Object.entries(
[".jsdos", ".wsz", ".zip"].includes(getExtension(path)) ZIP_EXTENSIONS.has(getExtension(path))
? await unzip(data) ? await unzip(data)
: await unarchive(path, data) : await unarchive(path, data)
); );

View File

@@ -164,7 +164,9 @@ export const MILLISECONDS_IN_MINUTE = 60000;
export const MILLISECONDS_IN_DAY = 86400000; export const MILLISECONDS_IN_DAY = 86400000;
export const MOUNTABLE_EXTENSIONS = new Set([".iso", ".jsdos", ".wsz", ".zip"]); export const ZIP_EXTENSIONS = new Set([".jsdos", ".pk3", ".wsz", ".zip"]);
export const MOUNTABLE_EXTENSIONS = new Set([".iso", ...ZIP_EXTENSIONS]);
export const SPREADSHEET_FORMATS = [ export const SPREADSHEET_FORMATS = [
".csv", ".csv",

View File

@@ -858,8 +858,9 @@ export const getMimeType = (url: string, ext?: string): string => {
return "image/webp"; return "image/webp";
case ".xml": case ".xml":
return "application/xml"; return "application/xml";
case ".wsz":
case ".jsdos": case ".jsdos":
case ".pk3":
case ".wsz":
case ".zip": case ".zip":
return "application/zip"; return "application/zip";
default: default: