(data, options)
| 63 | } |
| 64 | |
| 65 | function deflate(data, options) { |
| 66 | const deflate = new Deflate(options); |
| 67 | const chunkSize = options.chunkSize; |
| 68 | if (undefined === chunkSize) |
| 69 | deflate.push(data, true); |
| 70 | else { |
| 71 | for (let offset = 0; offset < data.byteLength; offset += chunkSize) { |
| 72 | const use = Math.min(chunkSize, data.byteLength - offset); |
| 73 | const last = (offset + chunkSize) >= data.byteLength; |
| 74 | deflate.push(data.slice(offset, offset + use), last); |
| 75 | } |
| 76 | } |
| 77 | deflate.close(); |
| 78 | return deflate.result; |
| 79 | } |
| 80 | |
| 81 | function inflate(data, options) { |
| 82 | const inflate = new Inflate(options); |
no test coverage detected