MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / loadAsync

Method loadAsync

src/pkg/utils/jszip-x.ts:103–117  ·  view source on GitHub ↗
(content: InputFileFormat)

Source from the content-addressed store, hash-verified

101 }
102
103 async loadAsync(content: InputFileFormat): Promise<this> {
104 const reader: ZipRandomAccessReader = await openZip(await toZipSource(await content), { pathMode: "unsafe" });
105 this.files = {};
106 try {
107 for (const entry of reader.entries) {
108 if (entry.isDirectory) {
109 continue;
110 }
111 this.files[entry.path] = new JSZippZipObject(entry.path, await entry.bytes(), entry.modifiedAt);
112 }
113 } finally {
114 await reader.close();
115 }
116 return this;
117 }
118
119 generateAsync(options: JSZipGenerateOptions & { type: "blob" }): Promise<Blob>;
120

Callers 1

loadAsyncJSZipFunction · 0.80

Calls 3

toZipSourceFunction · 0.85
closeMethod · 0.65
bytesMethod · 0.45

Tested by

no test coverage detected