MCPcopy Create free account
hub / github.com/TanStack/cli / recursivelyGatherFilesHelper

Function recursivelyGatherFilesHelper

packages/create/src/file-helpers.ts:150–173  ·  view source on GitHub ↗
(
  basePath: string,
  path: string,
  files: Record<string, string>,
  ignore: (filePath: string) => boolean,
)

Source from the content-addressed store, hash-verified

148}
149
150async function recursivelyGatherFilesHelper(
151 basePath: string,
152 path: string,
153 files: Record<string, string>,
154 ignore: (filePath: string) => boolean,
155) {
156 const dirFiles = await readdir(path, { withFileTypes: true })
157 for (const file of dirFiles) {
158 if (ignore(file.name)) {
159 continue
160 }
161 if (file.isDirectory()) {
162 await recursivelyGatherFilesHelper(
163 basePath,
164 resolve(path, file.name),
165 files,
166 ignore,
167 )
168 } else {
169 const filePath = resolve(path, file.name)
170 files[toCleanPath(filePath, basePath)] = await readFileHelper(filePath)
171 }
172 }
173}
174
175export async function recursivelyGatherFiles(
176 path: string,

Callers 1

recursivelyGatherFilesFunction · 0.85

Calls 2

readFileHelperFunction · 0.85
toCleanPathFunction · 0.70

Tested by

no test coverage detected