mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Converted usage of do-not-zip to use toArray instead of toBuffer in order to have explicit instead of implict Buffer dependency from the do-not-zip
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Readable, Stream } from "node:stream";
|
||||
import * as Messages from "./messages";
|
||||
import * as zip from "do-not-zip";
|
||||
import { toArray as zipToArray } from "do-not-zip";
|
||||
import { Buffer } from "node:buffer";
|
||||
|
||||
export const filesSymbol = Symbol("bundleFiles");
|
||||
export const freezeSymbol = Symbol("bundleFreeze");
|
||||
@@ -128,7 +129,7 @@ export default class Bundle {
|
||||
|
||||
public getAsBuffer(): Buffer {
|
||||
this[freezeSymbol]();
|
||||
return zip.toBuffer(createZipFilesMap(this[filesSymbol]));
|
||||
return Buffer.from(zipToArray(createZipFilesMap(this[filesSymbol])));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -142,7 +143,7 @@ export default class Bundle {
|
||||
public getAsStream(): Stream {
|
||||
this[freezeSymbol]();
|
||||
return Readable.from(
|
||||
zip.toBuffer(createZipFilesMap(this[filesSymbol])),
|
||||
Buffer.from(zipToArray(createZipFilesMap(this[filesSymbol]))),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user