From f90264d2462e0e24b9a4479b23443c518d24ef0d Mon Sep 17 00:00:00 2001 From: isaacs Date: Sat, 17 Sep 2011 23:03:36 -0700 Subject: [PATCH] zlib: lint --- lib/zlib.js | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/lib/zlib.js b/lib/zlib.js index 4dceb17d244..605d10338e3 100644 --- a/lib/zlib.js +++ b/lib/zlib.js @@ -59,13 +59,33 @@ exports.DeflateRaw = DeflateRaw; exports.InflateRaw = InflateRaw; exports.Unzip = Unzip; -exports.createDeflate = function (o) { return new Deflate(o); }; -exports.createInflate = function (o) { return new Inflate(o); }; -exports.createDeflateRaw = function (o) { return new DeflateRaw(o); }; -exports.createInflateRaw = function (o) { return new InflateRaw(o); }; -exports.createGzip = function (o) { return new Gzip(o); }; -exports.createGunzip = function (o) { return new Gunzip(o); }; -exports.createUnzip = function (o) { return new Unzip(o); }; +exports.createDeflate = function(o) { + return new Deflate(o); +}; + +exports.createInflate = function(o) { + return new Inflate(o); +}; + +exports.createDeflateRaw = function(o) { + return new DeflateRaw(o); +}; + +exports.createInflateRaw = function(o) { + return new InflateRaw(o); +}; + +exports.createGzip = function(o) { + return new Gzip(o); +}; + +exports.createGunzip = function(o) { + return new Gunzip(o); +}; + +exports.createUnzip = function(o) { + return new Unzip(o); +}; @@ -132,28 +152,28 @@ function Zlib(opts, Binding) { if (opts.chunkSize) { if (opts.chunkSize < exports.Z_MIN_CHUNK || opts.chunkSize > exports.Z_MAX_CHUNK) { - throw new Error("Invalid chunk size: "+opts.chunkSize); + throw new Error('Invalid chunk size: ' + opts.chunkSize); } } if (opts.windowBits) { if (opts.windowBits < exports.Z_MIN_WINDOWBITS || opts.windowBits > exports.Z_MAX_WINDOWBITS) { - throw new Error("Invalid windowBits: "+opts.windowBits); + throw new Error('Invalid windowBits: ' + opts.windowBits); } } if (opts.level) { if (opts.level < exports.Z_MIN_LEVEL || opts.level > exports.Z_MAX_LEVEL) { - throw new Error("Invalid compression level: "+opts.level); + throw new Error('Invalid compression level: ' + opts.level); } } if (opts.memLevel) { if (opts.memLevel < exports.Z_MIN_MEMLEVEL || opts.memLevel > exports.Z_MAX_MEMLEVEL) { - throw new Error("Invalid memLevel: "+opts.memLevel); + throw new Error('Invalid memLevel: ' + opts.memLevel); } } @@ -163,15 +183,15 @@ function Zlib(opts, Binding) { opts.strategy != exports.Z_RLE && opts.strategy != exports.Z_FIXED && opts.strategy != exports.Z_DEFAULT_STRATEGY) { - throw new Error("Invalid strategy: "+opts.strategy); + throw new Error('Invalid strategy: ' + opts.strategy); } } this._binding = new Binding(); this._binding.init(opts.windowBits || exports.Z_DEFAULT_WINDOWBITS, - opts.level || exports.Z_DEFAULT_COMPRESSION, - opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, - opts.strategy || exports.Z_DEFAULT_STRATEGY); + opts.level || exports.Z_DEFAULT_COMPRESSION, + opts.memLevel || exports.Z_DEFAULT_MEMLEVEL, + opts.strategy || exports.Z_DEFAULT_STRATEGY); this._chunkSize = opts.chunkSize || exports.Z_DEFAULT_CHUNK; this._buffer = new Buffer(this._chunkSize);