Comparing version 0.1.8 to 0.1.9
@@ -72,3 +72,3 @@ var fs = require("fs"), | ||
} else { | ||
callback(null) | ||
callback(null,"getEntry failed for:" + entry) | ||
} | ||
@@ -206,2 +206,3 @@ }, | ||
addLocalFolder : function(/*String*/localPath) { | ||
localPath = localPath.split("\\").join("/"); //windows fix | ||
if (localPath.charAt(localPath.length - 1) != "/") | ||
@@ -215,3 +216,3 @@ localPath += "/"; | ||
var entry = new ZipEntry(); | ||
entry.entryName = path.replace(localPath, ""); | ||
entry.entryName = path.split("\\").join("/").replace(localPath, ""); //windows fix | ||
var stats = fs.statSync(path); | ||
@@ -218,0 +219,0 @@ if (stats.isDirectory()) { |
@@ -0,0 +0,0 @@ var Utils = require("../util"), |
@@ -0,0 +0,0 @@ var Utils = require("../util"), |
@@ -0,0 +0,0 @@ var Utils = require("../util"), |
@@ -0,0 +0,0 @@ function JSDeflater(/*inbuff*/inbuf) { |
@@ -0,0 +0,0 @@ var Buffer = require("buffer").Buffer; |
{ | ||
"name": "adm-zip", | ||
"version": "0.1.8", | ||
"version": "0.1.9", | ||
"description": "A Javascript implementation of zip for nodejs. Allows user to create or extract zip files both in memory or to/from disk", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -0,0 +0,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -0,0 +0,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -0,0 +0,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
@@ -0,0 +0,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy |
var fs = require("fs"), | ||
pth = require("path"); | ||
fs.existsSync = fs.existsSync || pth.existsSync; | ||
@@ -4,0 +6,0 @@ module.exports = function(/*String*/path) { |
module.exports = require("./utils"); | ||
module.exports.Constants = require("./constants"); | ||
module.exports.Errors = require("./errors"); | ||
module.exports.FileAttr = require("./fattr"); | ||
module.exports.FileAttr = require("./fattr"); |
@@ -24,7 +24,8 @@ var Utils = require("./util"), | ||
if (async && callback) { | ||
callback(new Buffer()); | ||
callback(new Buffer(), "directory"); //si added error. | ||
} | ||
return; | ||
} | ||
throw 'Noting to decompress'; | ||
//throw 'Noting to decompress'; | ||
callback(new Buffer(), "Nothing to decompress");//si added error. | ||
} | ||
@@ -36,4 +37,9 @@ switch (_dataHeader.method) { | ||
if (Utils.crc32(_data) != _dataHeader.crc) { | ||
throw Utils.Errors.BAD_CRC | ||
} | ||
//throw Utils.Errors.BAD_CRC | ||
callback(_data, Utils.Errors.BAD_CRC);//si added error | ||
return Utils.Errors.BAD_CRC; | ||
} else {//si added otherwise did not seem to return data. | ||
if (callback) callback(_data); | ||
return 'ok'; | ||
} | ||
break; | ||
@@ -55,5 +61,9 @@ case Utils.Constants.DEFLATED: | ||
if (Utils.crc32(_data) != _dataHeader.crc) { | ||
throw Utils.Errors.BAD_CRC | ||
} | ||
callback(_data); | ||
//throw Utils.Errors.BAD_CRC | ||
callback(_data,Utils.Errors.BAD_CRC); //avoid throw it would bring down node. | ||
return Utils.Errors.BAD_CRC | ||
} else { | ||
callback(_data); | ||
return 'ok'; | ||
} | ||
}) | ||
@@ -63,3 +73,5 @@ } | ||
default: | ||
throw Utils.Errors.UNKNOWN_METHOD; | ||
// throw Utils.Errors.UNKNOWN_METHOD; | ||
callback(new Buffer(),Utils.Errors.BAD_CRC); //avoid throw it would bring down node. | ||
return Utils.Errors.UNKNOWN_METHOD; | ||
} | ||
@@ -66,0 +78,0 @@ } else { |
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
2666
144578