MCPcopy Create free account
hub / github.com/error311/FileRise / normalizeArchiveName

Function normalizeArchiveName

public/js/fileActions.js:95–109  ·  view source on GitHub ↗
(raw, format)

Source from the content-addressed store, hash-verified

93}
94
95function normalizeArchiveName(raw, format) {
96 let name = String(raw || "").trim();
97 if (!name) return "";
98 const ext = format === "7z" ? "7z" : format;
99 const lower = name.toLowerCase();
100 for (const suffix of ARCHIVE_NAME_SUFFIXES) {
101 const token = "." + suffix;
102 if (lower.endsWith(token)) {
103 name = name.slice(0, -token.length);
104 break;
105 }
106 }
107 if (name === "") name = "files";
108 return name + "." + ext;
109}
110
111function updateArchiveNamePlaceholder(format) {
112 const input = document.getElementById("zipFileNameInput");

Callers 2

fileActions.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected