MCPcopy Index your code
hub / github.com/npmx-dev/npmx.dev / countFiles

Function countFiles

server/utils/compare.ts:215–223  ·  view source on GitHub ↗
(tree: PackageFileTree[])

Source from the content-addressed store, hash-verified

213
214/** Count total files in a tree */
215export function countFiles(tree: PackageFileTree[]): number {
216 let count = 0
217
218 traverse(tree, node => {
219 if (node.type === 'file') count++
220 })
221
222 return count
223}
224
225/** Build the full compare response */
226export function buildCompareResponse(

Callers 1

buildCompareResponseFunction · 0.85

Calls 1

traverseFunction · 0.70

Tested by

no test coverage detected