MCPcopy Create free account
hub / github.com/ds300/patch-package / removeIgnoredFiles

Function removeIgnoredFiles

src/filterFiles.ts:5–17  ·  view source on GitHub ↗
(
  dir: string,
  includePaths: RegExp,
  excludePaths: RegExp,
)

Source from the content-addressed store, hash-verified

3import klawSync from "klaw-sync"
4
5export function removeIgnoredFiles(
6 dir: string,
7 includePaths: RegExp,
8 excludePaths: RegExp,
9) {
10 klawSync(dir, { nodir: true })
11 .map((item) => item.path.slice(`${dir}/`.length))
12 .filter(
13 (relativePath) =>
14 !relativePath.match(includePaths) || relativePath.match(excludePaths),
15 )
16 .forEach((relativePath) => removeSync(join(dir, relativePath)))
17}

Callers 1

makePatchFunction · 0.90

Calls 1

joinFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…