(from: number)
| 552 | let deflates: Array<Deflating | undefined> = [] |
| 553 | |
| 554 | const startDeflates = (from: number): void => { |
| 555 | for (let i = from; i < Math.min(entries.length, from + DEFLATE_AHEAD); i++) { |
| 556 | if (deflates[i] !== undefined) continue |
| 557 | const { content, header } = entries[i] |
| 558 | if (header.type !== "File" || header.method !== "Deflate" || content === undefined) continue |
| 559 | if (i > from && content.length > DEFLATE_AHEAD_SIZE) continue |
| 560 | const deflating: Deflating = { promise: deflateBytes(content), data: undefined } |
| 561 | // Failures surface when the entry is written; deflates left behind by |
| 562 | // a failed encode finish on their own |
| 563 | deflating.promise.then((data) => { |
| 564 | deflating.data = data |
| 565 | }, () => {}) |
| 566 | deflates[i] = deflating |
| 567 | } |
| 568 | } |
| 569 | |
| 570 | const write = (f: () => void): Effect.Effect<void, ZipError> => { |
| 571 | try { |
no test coverage detected