mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Convert ArrayBufferLike to Buffer
This commit is contained in:
1 parent
59709280da
commit
10a87d47da
2 files changed
+2
-2
No files matched your search
@@ -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");
|
||||||
|
|||||||
@@ -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");
|
||||||
|
|||||||
Reference in new issue
Block a user