Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions lib/gzip.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
(function () {
(function (exports) {
'use strict';

var crc32 = require('crc32'),
deflate = require('deflate-js'),
var crc32 = exports.crc32 || require('crc32'),
deflate = exports.deflate || require('deflate-js'),
// magic numbers marking this file as GZIP
ID1 = 0x1F,
ID2 = 0x8B,
Expand Down Expand Up @@ -126,7 +126,7 @@
function zip(data, options) {
var flags = 0,
level,
crc, out = [];
out = [];

if (!options) {
options = {};
Expand Down Expand Up @@ -184,15 +184,14 @@
return out;
}

function unzip(data, options) {
function unzip(data/*, options*/) {
// start with a copy of the array
var arr = Array.prototype.slice.call(data, 0),
t,
compressionMethod,
flags,
mtime,
xFlags,
key,
os,
crc,
size,
Expand Down Expand Up @@ -270,11 +269,11 @@
return res;
}

module.exports = {
zip: zip,
unzip: unzip,
get DEFAULT_LEVEL() {
exports.zip = zip;
exports.unzip = unzip;
Object.defineProperty(exports, 'DEFAULT_LEVEL', {
get: function () {
return DEFAULT_LEVEL;
}
};
}());
});
}('undefined' !== typeof window ? window : exports));