Use strict type checking

This commit is contained in:
Hornwitser committed 2023-08-12 02:31:17 +02:00
1 parent 2ca8e69025
commit a66e930997
36 files changed
+714 -676

No files matched your search

+2 -2
View File
@@ -363,7 +363,7 @@ export function readMapExchangeString(exchangeString: string) {
try {
// eslint-disable-next-line node/no-sync
buf = zlib.inflateSync(buf);
} catch (err) {
} catch (err: any) {
if (err.code.startsWith("Z_")) {
throw new Error("Malformed map exchange string: zlib inflate failed");
}
@@ -380,7 +380,7 @@ export function readMapExchangeString(exchangeString: string) {
map_settings: readMapSettings(state),
checksum: readUInt32(state),
};
} catch (err) {
} catch (err: any) {
if (err.code === "ERR_OUT_OF_RANGE") {
throw new Error("Malformed map exchange string: reached end before finishing parsing");
}