MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / isBinaryFile

Function isBinaryFile

src/utils/binaryExtensions.js:326–336  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

324]);
325
326export function isBinaryFile(file) {
327 if (typeof file === "string") return isBinaryPath(file);
328 if (!file) return false;
329
330 const mime = file.mime || file.type;
331 if (isTextMime(mime)) return false;
332 if (isTextPath(file.url || file.path || file.name)) return false;
333 if (isBinaryMime(mime)) return true;
334
335 return isBinaryPath(file.url || file.path || file.name);
336}
337
338export function isTextPath(file) {
339 const path = String(file ?? "").split(/[?#]/)[0];

Callers 2

isBinaryFunction · 0.90
testFunction · 0.90

Calls 4

isBinaryPathFunction · 0.85
isTextMimeFunction · 0.85
isTextPathFunction · 0.85
isBinaryMimeFunction · 0.85

Tested by 1

testFunction · 0.72