lib/common/sitemap.js
function convert(options, buffer, next, callback) {
  var gunzip = path.extname(options.source) === ".gz";

  if (gunzip) {
    zlib.gunzip(buffer, function (err, result) {
      if (err) {
        callback(common.prependMsgToErr(err, options.source, true));
      } else {
        next(options, result && result.toString(), callback);
      }
    });
  }
  else {
    next(options, buffer.toString(), callback);
  }
}
function convert(options, buffer, next, callback) {
  var gunzip = path.extname(options.source) === ".gz";

  if (gunzip) {
    zlib.gunzip(buffer, function (err, result) {
      if (err) {
        callback(common.prependMsgToErr(err, options.source, true));
      } else {
        next(options, result && result.toString(), callback);
      }
    });
  }
  else {
    next(options, buffer.toString(), callback);
  }
}
Convert Buffer input, call next or callback with error

@param {Object} options - Sitemap options.
@param {String} options.source - Sitemap URL.
@param {Buffer} buffer - A node buffer.
@param {Function} next - A function to run after optional conversion applied.
@param {Function} callback - A completion callback.