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

Function test

src/sidebarApps/searchInFiles/worker.js:285–291  ·  view source on GitHub ↗

* Tests whether a file should be skipped based on exclusion and inclusion patterns. * * @param {object} file - The file to be tested. * @param {string} file.path - The relative URL of the file. * @returns {boolean} - Returns true if the file should be skipped, false otherwise.

(file)

Source from the content-addressed store, hash-verified

283 * @returns {boolean} - Returns true if the file should be skipped, false otherwise.
284 */
285 function test(file) {
286 if (!file.path) return false;
287 if (isBinaryFile(file)) return true;
288 const match = (pattern) =>
289 picomatch.isMatch(file.path, pattern, { matchBase: true });
290 return excludeFiles.some(match) || !includeFiles.some(match);
291 }
292
293 return {
294 test,

Callers

nothing calls this directly

Calls 1

isBinaryFileFunction · 0.90

Tested by

no test coverage detected