MCPcopy
hub / github.com/gildas-lormeau/zip.js / getData

Method getData

index.cjs:6415–6428  ·  view source on GitHub ↗
(writer, options = {})

Source from the content-addressed store, hash-verified

6413 }
6414
6415 async getData(writer, options = {}) {
6416 const zipEntry = this;
6417 if (!writer || (writer.constructor == zipEntry.Writer && zipEntry.data)) {
6418 return zipEntry.data;
6419 } else {
6420 const reader = zipEntry.reader = new zipEntry.Reader(zipEntry.data, options);
6421 const uncompressedSize = zipEntry.data ? zipEntry.data.uncompressedSize : reader.size;
6422 await Promise.all([initStream(reader), initStream(writer, uncompressedSize)]);
6423 const { readable } = reader;
6424 zipEntry.uncompressedSize = reader.size;
6425 await readable.pipeTo(writer.writable);
6426 return writer.getData ? writer.getData() : writer.writable;
6427 }
6428 }
6429
6430 isPasswordProtected() {
6431 return this.data.encrypted;

Callers 5

getTextMethod · 0.95
getBlobMethod · 0.95
getData64URIMethod · 0.95
getUint8ArrayMethod · 0.95
getWritableMethod · 0.95

Calls 2

initStreamFunction · 0.70
getDataMethod · 0.65

Tested by

no test coverage detected