Merge pull request #21 from stefanoamorelli/fix/code-ingest-substring-exclude
fix: stop dropping source files whose name contains an exclude fragment
This commit is contained in:
1 file changed
+3
-4
@@ -212,14 +212,13 @@ const EXPOSURE_BASE: Record<Exposure, number> = {
|
|||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
function isExcluded(path: string, excludeGlobs: string[]): boolean {
|
function isExcluded(path: string, excludeGlobs: string[]): boolean {
|
||||||
// Loose match: any exclude fragment appearing as a path segment (or substring)
|
// Bare fragments match a path SEGMENT only; glob (`*`) entries match as a
|
||||||
// rejects the path. Prototype-grade — not a real glob engine.
|
// substring.
|
||||||
const segments = path.split(sep);
|
const segments = path.split(sep);
|
||||||
for (const ex of excludeGlobs) {
|
for (const ex of excludeGlobs) {
|
||||||
if (!ex) continue;
|
if (!ex) continue;
|
||||||
// Treat a bare fragment as "matches any segment equal to it OR any substring".
|
|
||||||
if (segments.includes(ex)) return true;
|
if (segments.includes(ex)) return true;
|
||||||
if (path.includes(ex)) return true;
|
if (ex.includes('*') && path.includes(ex.replace(/\*/g, ''))) return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user