@character-foundry/character-foundry 0.1.8 → 0.1.9-dev.1765913722

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/voxta.cjs CHANGED
@@ -206,7 +206,23 @@ function streamingUnzipSync(data, limits = DEFAULT_ZIP_LIMITS) {
206
206
  if (unsafePathHandling === "warn" && limits.onUnsafePath) {
207
207
  limits.onUnsafePath(file.name, reason);
208
208
  }
209
- file.ondata = () => {
209
+ file.ondata = (err, chunk, _final) => {
210
+ if (error) return;
211
+ if (err) {
212
+ error = err;
213
+ return;
214
+ }
215
+ if (chunk && chunk.length > 0) {
216
+ totalBytes += chunk.length;
217
+ if (totalBytes > limits.maxTotalSize) {
218
+ error = new ZipPreflightError(
219
+ `Total actual size ${totalBytes} exceeds limit ${limits.maxTotalSize}`,
220
+ totalBytes,
221
+ limits.maxTotalSize
222
+ );
223
+ file.terminate();
224
+ }
225
+ }
210
226
  };
211
227
  file.start();
212
228
  return;