Convert ArrayBufferLike to Buffer

This commit is contained in:
Danielv123 committed 2025-08-01 21:19:58 +00:00
1 parent 59709280da
commit 10a87d47da
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -218,7 +218,7 @@ export default class ModPack {
let buf = Buffer.from(modPackString, "base64"); let buf = Buffer.from(modPackString, "base64");
try { try {
// eslint-disable-next-line node/no-sync // eslint-disable-next-line node/no-sync
buf = zlib.inflateSync(buf); buf = Buffer.from(zlib.inflateSync(buf));
} catch (err: any) { } catch (err: any) {
if (err.code.startsWith("Z_")) { if (err.code.startsWith("Z_")) {
throw new Error("Malformed mod pack string: zlib inflate failed"); throw new Error("Malformed mod pack string: zlib inflate failed");
+1 -1
View File
@@ -414,7 +414,7 @@ export function readMapExchangeString(exchangeString: string) {
let buf = Buffer.from(exchangeString.slice(3, -3), "base64"); let buf = Buffer.from(exchangeString.slice(3, -3), "base64");
try { try {
// eslint-disable-next-line node/no-sync // eslint-disable-next-line node/no-sync
buf = zlib.inflateSync(buf); buf = Buffer.from(zlib.inflateSync(buf));
} catch (err: any) { } catch (err: any) {
if (err.code.startsWith("Z_")) { if (err.code.startsWith("Z_")) {
throw new Error("Malformed map exchange string: zlib inflate failed"); throw new Error("Malformed map exchange string: zlib inflate failed");