Skip to content

pantoken-root / plugins/vite/workspace-orchestrator/src / matchesFilters

دالة: matchesFilters() ​

matchesFilters(filename, node): boolean

Experimental

يعيد true إذا كان اسم الملف المُعدَّل يمر عبر مرشحات include/ignore الخاصة بالعقدة.

Parameters ​

filename ​

string

node ​

UpstreamNode

Returns ​

boolean

Example ​

ts
import { matchesFilters } from "@pantoken/vite-workspace-orchestrator";

const node = {
  name: "@pantoken/components",
  dir: "/repo/formats/components",
  watchPaths: ["/repo/formats/components/src"],
  build: ["pnpm", "run", "build"] as const,
  dependents: [],
  include: ["**/*.ts"],
  ignore: ["**/*.test.ts"],
};

matchesFilters("src/index.ts", node); // true
matchesFilters("src/index.test.ts", node); // false (ignored)