'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = deflate;

var _zlib;

function _load_zlib() {
  return _zlib = _interopRequireDefault(require('zlib'));
}

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function deflate(buffer) {
  return new Promise(function (resolve, reject) {
    (_zlib || _load_zlib()).default.deflate(buffer, function (err, res) {
      if (err) return reject(err);
      return resolve(res);
    });
  });
}