MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createZipFromDirectory

Function createZipFromDirectory

src/utils/plugins/zipCache.ts:216–229  ·  view source on GitHub ↗
(
  sourceDir: string,
)

Source from the content-addressed store, hash-verified

214 * @returns ZIP file as Uint8Array
215 */
216export async function createZipFromDirectory(
217 sourceDir: string,
218): Promise<Uint8Array> {
219 const files: Record<string, ZipEntry> = {}
220 const visited = new Set<string>()
221 await collectFilesForZip(sourceDir, '', files, visited)
222
223 const { zipSync } = await import('fflate')
224 const zipData = zipSync(files, { level: 6 })
225 logForDebugging(
226 `Created ZIP from ${sourceDir}: ${Object.keys(files).length} files, ${zipData.length} bytes`,
227 )
228 return zipData
229}
230
231/**
232 * Recursively collect files from a directory for zipping.

Callers 1

Calls 3

collectFilesForZipFunction · 0.85
logForDebuggingFunction · 0.85
keysMethod · 0.80

Tested by

no test coverage detected