Comparing version 2.3.0 to 2.3.1
'use strict'; | ||
var hasSyncZlib = true; | ||
var zlib = require('zlib'); | ||
if (!zlib.deflateSync) { | ||
// Backwards compatibility with 0.10. | ||
zlib = require('node-zlib-backport'); | ||
try { | ||
zlib = require('node-zlib-backport'); | ||
} | ||
catch(ex) { | ||
hasSyncZlib = false; | ||
} | ||
} | ||
@@ -12,2 +18,7 @@ var constants = require('./constants'); | ||
module.exports = function(metaData, opt) { | ||
if (!hasSyncZlib) { | ||
throw new Error('To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport'); | ||
} | ||
var options = opt || {}; | ||
@@ -14,0 +25,0 @@ |
'use strict'; | ||
var hasSyncZlib = true; | ||
var zlib = require('zlib'); | ||
if (!zlib.inflateSync) { | ||
if (!zlib.deflateSync) { | ||
// Backwards compatibility with 0.10. | ||
zlib = require('node-zlib-backport'); | ||
try { | ||
zlib = require('node-zlib-backport'); | ||
} | ||
catch(ex) { | ||
hasSyncZlib = false; | ||
} | ||
} | ||
@@ -17,2 +23,6 @@ var SyncReader = require('./sync-reader'); | ||
if (!hasSyncZlib) { | ||
throw new Error('To use the sync capability of this library in old node versions, please also add a dependency on node-zlb-backport'); | ||
} | ||
var err; | ||
@@ -89,2 +99,1 @@ function handleError(_err_) { | ||
}; | ||
{ | ||
"name": "pngjs", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "PNG encoder/decoder in pure JS, supporting any bit size & interlace, async & sync with full test suite.", | ||
@@ -52,5 +52,2 @@ "contributors": [ | ||
}, | ||
"optionalDependencies": { | ||
"node-zlib-backport": "^0.11.15" | ||
}, | ||
"devDependencies": { | ||
@@ -57,0 +54,0 @@ "buffer-equal": "1.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
710376
0
2571