Skip to content

resolveIntersection

resolveIntersection(a, b, opts?): Promise<string[]>

The concrete on-disk files that fall in BOTH a and b.

ParameterTypeDescription
aPatternsThe first scope (Patterns).
bPatternsThe second scope (Patterns).
opts?FsOptionsFsOptions: matching semantics plus on-disk controls.

Promise<string[]>

The files matching both a and b, sorted; cwd-relative unless opts.absolute.

const both = await resolveIntersection(["src/**"], ["src/api/**"], { cwd: repoRoot });
// → ["src/api/routes/list.ts", "src/api/user.ts"] (only files under both scopes)