@discordjs/ws 3.0.0-pr-10758.1765463096-d081e1706 → 3.0.0-pr-11005.1765463668-087384722
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/defaultWorker.js +3 -27
- package/dist/defaultWorker.js.map +1 -1
- package/dist/defaultWorker.mjs +3 -27
- package/dist/defaultWorker.mjs.map +1 -1
- package/dist/index.d.mts +1 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.js +5 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -474,15 +474,13 @@ var Encoding = /* @__PURE__ */ ((Encoding2) => {
|
|
|
474
474
|
var CompressionMethod = /* @__PURE__ */ ((CompressionMethod2) => {
|
|
475
475
|
CompressionMethod2[CompressionMethod2["ZlibNative"] = 0] = "ZlibNative";
|
|
476
476
|
CompressionMethod2[CompressionMethod2["ZlibSync"] = 1] = "ZlibSync";
|
|
477
|
-
CompressionMethod2[CompressionMethod2["ZstdNative"] = 2] = "ZstdNative";
|
|
478
477
|
return CompressionMethod2;
|
|
479
478
|
})(CompressionMethod || {});
|
|
480
|
-
var DefaultDeviceProperty = `@discordjs/ws 3.0.0-pr-
|
|
479
|
+
var DefaultDeviceProperty = `@discordjs/ws 3.0.0-pr-11005.1765463668-087384722`;
|
|
481
480
|
var getDefaultSessionStore = lazy(() => new Collection4());
|
|
482
481
|
var CompressionParameterMap = {
|
|
483
482
|
[0 /* ZlibNative */]: "zlib-stream",
|
|
484
|
-
[1 /* ZlibSync */]: "zlib-stream"
|
|
485
|
-
[2 /* ZstdNative */]: "zstd-stream"
|
|
483
|
+
[1 /* ZlibSync */]: "zlib-stream"
|
|
486
484
|
};
|
|
487
485
|
var DefaultWebSocketManagerOptions = {
|
|
488
486
|
async buildIdentifyThrottler(manager) {
|
|
@@ -659,7 +657,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
|
|
|
659
657
|
});
|
|
660
658
|
this.nativeInflate = inflate;
|
|
661
659
|
} else {
|
|
662
|
-
console.warn("WebSocketShard: Compression is set to native
|
|
660
|
+
console.warn("WebSocketShard: Compression is set to native but node:zlib is not available.");
|
|
663
661
|
params.delete("compress");
|
|
664
662
|
}
|
|
665
663
|
break;
|
|
@@ -677,28 +675,6 @@ var WebSocketShard = class extends AsyncEventEmitter {
|
|
|
677
675
|
}
|
|
678
676
|
break;
|
|
679
677
|
}
|
|
680
|
-
case 2 /* ZstdNative */: {
|
|
681
|
-
const zlib = await getNativeZlib();
|
|
682
|
-
if (zlib && "createZstdDecompress" in zlib) {
|
|
683
|
-
this.inflateBuffer = [];
|
|
684
|
-
const inflate = zlib.createZstdDecompress({
|
|
685
|
-
chunkSize: 65535
|
|
686
|
-
});
|
|
687
|
-
inflate.on("data", (chunk) => {
|
|
688
|
-
this.inflateBuffer.push(chunk);
|
|
689
|
-
});
|
|
690
|
-
inflate.on("error", (error) => {
|
|
691
|
-
this.emit("error" /* Error */, error);
|
|
692
|
-
});
|
|
693
|
-
this.nativeInflate = inflate;
|
|
694
|
-
} else {
|
|
695
|
-
console.warn(
|
|
696
|
-
"WebSocketShard: Compression is set to native zstd but node:zlib is not available or your node version does not support zstd decompression."
|
|
697
|
-
);
|
|
698
|
-
params.delete("compress");
|
|
699
|
-
}
|
|
700
|
-
break;
|
|
701
|
-
}
|
|
702
678
|
}
|
|
703
679
|
}
|
|
704
680
|
if (this.identifyCompressionEnabled) {
|
|
@@ -981,7 +957,7 @@ var WebSocketShard = class extends AsyncEventEmitter {
|
|
|
981
957
|
});
|
|
982
958
|
}
|
|
983
959
|
if (this.transportCompressionEnabled) {
|
|
984
|
-
const flush =
|
|
960
|
+
const flush = decompressable.length >= 4 && decompressable.at(-4) === 0 && decompressable.at(-3) === 0 && decompressable.at(-2) === 255 && decompressable.at(-1) === 255;
|
|
985
961
|
if (this.nativeInflate) {
|
|
986
962
|
const doneWriting = new Promise((resolve2) => {
|
|
987
963
|
this.nativeInflate.write(decompressable, "binary", (error) => {
|
|
@@ -1571,7 +1547,7 @@ var WebSocketManager = class extends AsyncEventEmitter2 {
|
|
|
1571
1547
|
};
|
|
1572
1548
|
|
|
1573
1549
|
// src/index.ts
|
|
1574
|
-
var version = "3.0.0-pr-
|
|
1550
|
+
var version = "3.0.0-pr-11005.1765463668-087384722";
|
|
1575
1551
|
export {
|
|
1576
1552
|
CloseCodes,
|
|
1577
1553
|
CompressionMethod,
|