@laplace.live/ws 6.3.7 → 6.3.8
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/browser.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as Live, I as Inflates, a as LiveOptions, K as KeepLive } from './common-
|
|
2
|
-
export { D as DataEvent, E as EventEvent } from './common-
|
|
1
|
+
import { L as Live, I as Inflates, a as LiveOptions, K as KeepLive } from './common-CdO2EmGc.js';
|
|
2
|
+
export { D as DataEvent, E as EventEvent } from './common-CdO2EmGc.js';
|
|
3
3
|
|
|
4
4
|
type WSOptions = LiveOptions & {
|
|
5
5
|
address?: string;
|
package/dist/browser.js
CHANGED
|
@@ -65,12 +65,10 @@ var makeDecoder = ({ inflateAsync: inflateAsync2, brotliDecompressAsync: brotliD
|
|
|
65
65
|
return decoder;
|
|
66
66
|
};
|
|
67
67
|
var encoder = (type, body = "") => {
|
|
68
|
-
|
|
69
|
-
body = JSON.stringify(body);
|
|
70
|
-
}
|
|
68
|
+
const encoded = typeof body === "string" ? body : JSON.stringify(body);
|
|
71
69
|
const head = new Uint8Array(16);
|
|
72
70
|
const headView = new DataView(head.buffer, head.byteOffset, head.byteLength);
|
|
73
|
-
const buffer = textEncoder.encode(
|
|
71
|
+
const buffer = textEncoder.encode(encoded);
|
|
74
72
|
headView.setInt32(0, buffer.length + head.length);
|
|
75
73
|
headView.setInt16(4, 16);
|
|
76
74
|
headView.setInt16(6, 1);
|
|
@@ -162,10 +160,7 @@ var Live = class extends EventTarget {
|
|
|
162
160
|
});
|
|
163
161
|
this.addEventListener("open", () => {
|
|
164
162
|
if (authBody) {
|
|
165
|
-
|
|
166
|
-
authBody = encoder("join", authBody);
|
|
167
|
-
}
|
|
168
|
-
this.send(authBody);
|
|
163
|
+
this.send(authBody instanceof Uint8Array ? authBody : encoder("join", authBody));
|
|
169
164
|
} else {
|
|
170
165
|
const hi = { uid, roomid, protover, platform: "web", type: 2 };
|
|
171
166
|
if (key) {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as Live, I as Inflates, a as LiveOptions, K as KeepLive } from './common-
|
|
2
|
-
export { D as DataEvent, E as EventEvent } from './common-
|
|
1
|
+
import { L as Live, I as Inflates, a as LiveOptions, K as KeepLive } from './common-CdO2EmGc.js';
|
|
2
|
+
export { D as DataEvent, E as EventEvent } from './common-CdO2EmGc.js';
|
|
3
3
|
import { Socket } from 'node:net';
|
|
4
4
|
import { Agent } from 'node:http';
|
|
5
5
|
import WS from 'ws';
|
package/dist/index.js
CHANGED
|
@@ -65,12 +65,10 @@ var makeDecoder = ({ inflateAsync: inflateAsync2, brotliDecompressAsync: brotliD
|
|
|
65
65
|
return decoder;
|
|
66
66
|
};
|
|
67
67
|
var encoder = (type, body = "") => {
|
|
68
|
-
|
|
69
|
-
body = JSON.stringify(body);
|
|
70
|
-
}
|
|
68
|
+
const encoded = typeof body === "string" ? body : JSON.stringify(body);
|
|
71
69
|
const head = new Uint8Array(16);
|
|
72
70
|
const headView = new DataView(head.buffer, head.byteOffset, head.byteLength);
|
|
73
|
-
const buffer = textEncoder.encode(
|
|
71
|
+
const buffer = textEncoder.encode(encoded);
|
|
74
72
|
headView.setInt32(0, buffer.length + head.length);
|
|
75
73
|
headView.setInt16(4, 16);
|
|
76
74
|
headView.setInt16(6, 1);
|
|
@@ -162,10 +160,7 @@ var Live = class extends EventTarget {
|
|
|
162
160
|
});
|
|
163
161
|
this.addEventListener("open", () => {
|
|
164
162
|
if (authBody) {
|
|
165
|
-
|
|
166
|
-
authBody = encoder("join", authBody);
|
|
167
|
-
}
|
|
168
|
-
this.send(authBody);
|
|
163
|
+
this.send(authBody instanceof Uint8Array ? authBody : encoder("join", authBody));
|
|
169
164
|
} else {
|
|
170
165
|
const hi = { uid, roomid, protover, platform: "web", type: 2 };
|
|
171
166
|
if (key) {
|