* Deflate drives actual compression of data * @param flush True to flush input buffers * @param finish Finish deflation with the current input. * @returns Returns true if progress has been made.
(flush: boolean, finish: boolean)
| 186 | * @returns Returns true if progress has been made. |
| 187 | */ |
| 188 | public deflate(flush: boolean, finish: boolean): boolean { |
| 189 | let progress: boolean; |
| 190 | do { |
| 191 | this.fillWindow(); |
| 192 | const canFlush = flush && this._inputOff === this._inputEnd; |
| 193 | progress = this._deflateSlow(canFlush, finish); |
| 194 | } while (this._pending.isFlushed && progress); // repeat while we have no pending output and progress was made |
| 195 | return progress; |
| 196 | } |
| 197 | |
| 198 | private _deflateSlow(flush: boolean, finish: boolean): boolean { |
| 199 | if (this._lookahead < DeflaterConstants.minLookahead && !flush) { |
nothing calls this directly
no test coverage detected