diff --git a/lib/gzip.js b/lib/gzip.js index 9dc8f1e..bfcdb9b 100644 --- a/lib/gzip.js +++ b/lib/gzip.js @@ -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, @@ -126,7 +126,7 @@ function zip(data, options) { var flags = 0, level, - crc, out = []; + out = []; if (!options) { options = {}; @@ -184,7 +184,7 @@ 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, @@ -192,7 +192,6 @@ flags, mtime, xFlags, - key, os, crc, size, @@ -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));