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

Function isTextPath

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

Source from the content-addressed store, hash-verified

336}
337
338export function isTextPath(file) {
339 const path = String(file ?? "").split(/[?#]/)[0];
340 const basename = path.split(/[\\/]/).pop()?.toLowerCase() || "";
341 const lastDot = basename.lastIndexOf(".");
342 if (lastDot === -1) return false;
343 return textExtensionSet.has(basename.slice(lastDot + 1));
344}
345
346export function isBinaryPath(file) {
347 const path = String(file ?? "").split(/[?#]/)[0];

Callers 1

isBinaryFileFunction · 0.85

Calls 1

StringInterface · 0.85

Tested by

no test coverage detected