function Deflate$1(options) {
    this.options = common.assign({
      level: Z_DEFAULT_COMPRESSION,
      method: Z_DEFLATED$1,
      chunkSize: 16384,
      windowBits: 15,
      memLevel: 8,
      strategy: Z_DEFAULT_STRATEGY
    }, options || {});
    var opt = this.options;
    if (opt.raw && opt.windowBits > 0) {
      opt.windowBits = -opt.windowBits;
    } else if (opt.gzip && opt.windowBits > 0 && opt.windowBits < 16) {
      opt.windowBits += 16;
    }
    this.err = 0; // error code, if happens (0 = Z_OK)
    this.msg = ''; // error message
    this.ended = false; // used to avoid multiple onEnd() calls
    this.chunks = []; // chunks of compressed data

    this.strm = new zstream();
    this.strm.avail_out = 0;
    var status = deflate_1$2.deflateInit2(this.strm, opt.level, opt.method, opt.windowBits, opt.memLevel, opt.strategy);
    if (status !== Z_OK$2) {
      throw new Error(messages[status]);
    }
    if (opt.header) {
      deflate_1$2.deflateSetHeader(this.strm, opt.header);
    }
    if (opt.dictionary) {
      var dict;
      // Convert data if needed
      if (typeof opt.dictionary === 'string') {
        // If we need to compress text, change encoding to utf8.
        dict = strings.string2buf(opt.dictionary);
      } else if (toString$1.call(opt.dictionary) === '[object ArrayBuffer]') {
        dict = new Uint8Array(opt.dictionary);
      } else {
        dict = opt.dictionary;
      }
      status = deflate_1$2.deflateSetDictionary(this.strm, dict);
      if (status !== Z_OK$2) {
        throw new Error(messages[status]);
      }
      this._dict_set = true;
    }
  }
new Deflate(options)
- options (Object): zlib deflate options.

Creates new deflator instance with specified params. Throws exception
on bad params. Supported options:

- `level`
- `windowBits`
- `memLevel`
- `strategy`
- `dictionary`

[http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
for more information on these.

Additional options, for internal needs:

- `chunkSize` - size of generated data chunks (16K by default)
- `raw` (Boolean) - do raw deflate
- `gzip` (Boolean) - create gzip wrapper
- `header` (Object) - custom header for gzip
  - `text` (Boolean) - true if compressed data believed to be text
  - `time` (Number) - modification time, unix timestamp
  - `os` (Number) - operation system code
  - `extra` (Array) - array of bytes with extra data (max 65536)
  - `name` (String) - file name (binary string)
  - `comment` (String) - comment (binary string)
  - `hcrc` (Boolean) - true if header crc should be added

##### Example:

```javascript
const pako = require('pako')
  , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
  , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);

const deflate = new pako.Deflate({ level: 3});

deflate.push(chunk1, false);
deflate.push(chunk2, true);  // true -> last chunk

if (deflate.err) { throw new Error(deflate.err); }

console.log(deflate.result);
```