<commit_before>/**
 * node-archiver
 *
 * Copyright (c) 2012-2014 <NAME>, contributors.
 * Licensed under the MIT license.
 * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT
 */

var engine = require('zip-stream');
var util = require('../../util');

var Zip = module.exports = function(options) {
  options = this.options = util.defaults(options, {
    comment: '',
    forceUTC: false,
    store: false
  });

  if (typeof options.zlib !== 'object') {
    options.zlib = {};
  }

  if (store) {
    options.zlib.level = 0;
  } else if (typeof options.level === 'number' && options.level >= 0) {
    options.zlib.level = options.level;
    delete options.level;
  } else if (typeof options.zlib.level !== 'number') {
    options.zlib.level = 1;
  }

  this.engine = new engine(options);
};

Zip.prototype.append = function(source, data, callback) {
  this.engine.entry(source, data, callback);
};

Zip.prototype.finalize = function() {
  this.engine.finalize();
};

Zip.prototype.pipe = function(dest, pipeOpts) {
  return this.engine.pipe(dest, pipeOpts);
};<commit_msg>zip: fix invalid var.<commit_after>/**
 * node-archiver
 *
 * Copyright (c) 2012-2014 <NAME>, contributors.
 * Licensed under the MIT license.
 * https://github.com/ctalkington/node-archiver/blob/master/LICENSE-MIT
 */

var engine = require('zip-stream');
var util = require('../../util');

var Zip = module.exports = function(options) {
  options = this.options = util.defaults(options, {
    comment: '',
    forceUTC: false,
    store: false
  });

  if (typeof options.zlib !== 'object') {
    options.zlib = {};
  }

  if (options.store) {
    options.zlib.level = 0;
  } else if (typeof options.level === 'number' && options.level >= 0) {
    options.zlib.level = options.level;
    delete options.level;
  } else if (typeof options.zlib.level !== 'number') {
    options.zlib.level = 1;
  }

  this.engine = new engine(options);
};

Zip.prototype.append = function(source, data, callback) {
  this.engine.entry(source, data, callback);
};

Zip.prototype.finalize = function() {
  this.engine.finalize();
};

Zip.prototype.pipe = function(dest, pipeOpts) {
  return this.engine.pipe(dest, pipeOpts);
};
{'fraction_non_alphanumeric': 0.17136363636363636, 'fraction_numerical': 0.01, 'mean_word_length': 3.4554655870445345, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6240423', 'n_tokens_mistral': 745, 'n_tokens_neox': 714, 'n_words': 157}