mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +09:00
Use fflate for zlib in the web interface
ModPack and map exchange strings need synchronous inflate and deflate. In the browser these came from the browserify-zlib polyfill, which brings pako, assert and util along. The browser build now imports fflate through a #zlib_sync subpath import, Node.js keeps node:zlib. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
909f6ab08b
commit
4d7c1020b0
8 files changed
+64
-3
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import zlib from "zlib";
|
||||
import * as zlib from "#zlib_sync";
|
||||
import { Type, Static } from "@sinclair/typebox";
|
||||
|
||||
import * as libSchema from "../schema.js";
|
||||
@@ -306,7 +306,7 @@ export default class ModPack {
|
||||
|
||||
// eslint-disable-next-line node/no-sync
|
||||
let buf = zlib.deflateSync(JSON.stringify(json));
|
||||
return buf.toString("base64");
|
||||
return Buffer.from(buf).toString("base64");
|
||||
}
|
||||
|
||||
static fromModPackString(modPackString: string) {
|
||||
|
||||
Reference in new issue
Block a user