MCPcopy Index your code
hub / github.com/github/docs / walkFiles

Function walkFiles

script/helpers/walk-files.js:12–20  ·  view source on GitHub ↗
(dir, ext, opts = {})

Source from the content-addressed store, hash-verified

10import walk from 'walk-sync'
11
12export default function walkFiles(dir, ext, opts = {}) {
13 const extensions = Array.isArray(ext) ? ext : [ext]
14 const dirPath = path.posix.join(process.cwd(), dir)
15 const walkSyncOpts = { includeBasePath: true, directories: false }
16
17 return walk(dirPath, walkSyncOpts)
18 .filter((file) => extensions.some((ext) => file.endsWith(ext)) && !file.endsWith('README.md'))
19 .filter((file) => (opts.includeEarlyAccess ? file : !file.includes('/early-access/')))
20}

Calls

no outgoing calls

Tested by

no test coverage detected