MCPcopy Create free account
hub / github.com/TechJeeper/Printventory / buildScanExtensionSet

Function buildScanExtensionSet

scan-worker.js:171–184  ·  view source on GitHub ↗

* Normalize extension list from main (includes ADDITIONAL_FILE_TYPES_CATALOG selections: .obj, .step, .stp, …). * Used for both directory-queue filtering and processFile / ZIP entry matching so behavior stays consistent.

(scanExtensions)

Source from the content-addressed store, hash-verified

169 * Used for both directory-queue filtering and processFile / ZIP entry matching so behavior stays consistent.
170 */
171/** macOS ZIP junk: __MACOSX folder entries and AppleDouble (._*) resource forks */
172function isMacOsJunkZipEntry(entryPath) {
173 if (!entryPath) return false;
174 const normalized = entryPath.replace(/\\/g, '/');
175 if (normalized.split('/').some((seg) => seg.toLowerCase() === '__macosx')) return true;
176 const base = path.basename(entryPath);
177 return base.startsWith('._');
178}
179
180function buildScanExtensionSet(scanExtensions) {
181 const set = new Set();
182 const add = (raw) => {
183 if (raw == null || raw === '') return;
184 const s = String(raw).trim().toLowerCase();
185 if (!s) return;
186 set.add(s.startsWith('.') ? s : `.${s}`);
187 };

Callers 2

scanDirectoryFunction · 0.85
scan-worker.jsFile · 0.85

Calls 1

addFunction · 0.85

Tested by

no test coverage detected