MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / openZip

Function openZip

apps/vis/server/src/lib/zip-import.ts:120–130  ·  view source on GitHub ↗
(buffer: Buffer)

Source from the content-addressed store, hash-verified

118}
119
120function openZip(buffer: Buffer): Promise<ZipFile> {
121 return new Promise<ZipFile>((resolvePromise, reject) => {
122 fromBuffer(buffer, { lazyEntries: true }, (err, zipfile) => {
123 if (err !== null || zipfile === undefined) {
124 reject(new ZipImportError(`not a valid zip file: ${err?.message ?? 'unknown'}`));
125 return;
126 }
127 resolvePromise(zipfile);
128 });
129 });
130}

Callers 1

extractZipFunction · 0.85

Calls 1

rejectFunction · 0.85

Tested by

no test coverage detected