MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / createZipFromDirectory

Function createZipFromDirectory

source code/utils/plugins/zipCache.ts:218–231  ·  view source on GitHub ↗
(
  sourceDir: string,
)

Source from the content-addressed store, hash-verified

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