Skip to content

Commit 9c37fa8

Browse files
committed
minor fixes found from issues
1 parent d3f5d7b commit 9c37fa8

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

adm-zip.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ module.exports = function (/**String*/ input, /** object */ options) {
429429
// prepare new entry
430430
if (!update) {
431431
entry = new ZipEntry();
432-
entry.entryName = entryName;
432+
entry.entryName = Utils.canonical(entryName);
433433
}
434434
entry.comment = comment || "";
435435

@@ -464,6 +464,8 @@ module.exports = function (/**String*/ input, /** object */ options) {
464464

465465
entry.setData(content);
466466
if (!update) _zip.setEntry(entry);
467+
468+
return entry;
467469
},
468470

469471
/**

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"url": "https://github.com/cthackers/adm-zip.git"
3838
},
3939
"engines": {
40-
"node": ">=6.0"
40+
"node": ">=12.0"
4141
},
4242
"devDependencies": {
4343
"chai": "^4.3.4",

zipEntry.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ module.exports = function (/*Buffer*/ input) {
1212
_extra = Buffer.alloc(0);
1313

1414
function getCompressedDataFromZip() {
15-
if (!input || !Buffer.isBuffer(input)) {
15+
//if (!input || !Buffer.isBuffer(input)) {
16+
if (!input || !(input instanceof Uint8Array)) {
1617
return Buffer.alloc(0);
1718
}
1819
_centralHeader.loadLocalHeaderFromBinary(input);

0 commit comments

Comments
 (0)