MCPcopy
hub / github.com/prisma/prisma / decompressGzip

Function decompressGzip

packages/cli/src/bootstrap/template-scaffold.ts:102–115  ·  view source on GitHub ↗
(body: import('node:stream/web').ReadableStream)

Source from the content-addressed store, hash-verified

100}
101
102async function decompressGzip(body: import('node:stream/web').ReadableStream): Promise<Buffer> {
103 const gunzip = createGunzip()
104 const nodeStream = Readable.fromWeb(body)
105 const chunks: Buffer[] = []
106
107 return new Promise<Buffer>((resolve, reject) => {
108 nodeStream.on('error', reject)
109 nodeStream
110 .pipe(gunzip)
111 .on('data', (chunk: Buffer) => chunks.push(chunk))
112 .on('end', () => resolve(Buffer.concat(chunks)))
113 .on('error', reject)
114 })
115}
116
117interface TarEntry {
118 name: string

Callers 1

Calls 4

concatMethod · 0.80
onMethod · 0.65
resolveFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected