@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.js CHANGED
@@ -166,7 +166,23 @@ function streamingUnzipSync(data, limits = DEFAULT_ZIP_LIMITS) {
166
166
  if (unsafePathHandling === "warn" && limits.onUnsafePath) {
167
167
  limits.onUnsafePath(file.name, reason);
168
168
  }
169
- file.ondata = () => {
169
+ file.ondata = (err, chunk, _final) => {
170
+ if (error) return;
171
+ if (err) {
172
+ error = err;
173
+ return;
174
+ }
175
+ if (chunk && chunk.length > 0) {
176
+ totalBytes += chunk.length;
177
+ if (totalBytes > limits.maxTotalSize) {
178
+ error = new ZipPreflightError(
179
+ `Total actual size ${totalBytes} exceeds limit ${limits.maxTotalSize}`,
180
+ totalBytes,
181
+ limits.maxTotalSize
182
+ );
183
+ file.terminate();
184
+ }
185
+ }
170
186
  };
171
187
  file.start();
172
188
  return;