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

Function readAndUnzipFile

source code/utils/dxt/zip.ts:211–228  ·  view source on GitHub ↗
(
  filePath: string,
)

Source from the content-addressed store, hash-verified

209 * Returns its contents as a record of file paths to Uint8Array data.
210 */
211export async function readAndUnzipFile(
212 filePath: string,
213): Promise<Record<string, Uint8Array>> {
214 const fs = getFsImplementation()
215
216 try {
217 const zipData = await fs.readFileBytes(filePath)
218 // await is required here: without it, rejections from the now-async
219 // unzipFile() escape the try/catch and bypass the error wrapping below.
220 return await unzipFile(zipData)
221 } catch (error) {
222 if (isENOENT(error)) {
223 throw error
224 }
225 const errorMessage = error instanceof Error ? error.message : String(error)
226 throw new Error(`Failed to read or unzip file: ${errorMessage}`)
227 }
228}

Callers

nothing calls this directly

Calls 3

getFsImplementationFunction · 0.85
unzipFileFunction · 0.85
isENOENTFunction · 0.85

Tested by

no test coverage detected