@liveblocks/node 2.23.0 → 2.23.2
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/index.cjs +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -3,7 +3,7 @@ var _core = require('@liveblocks/core');
|
|
|
3
3
|
|
|
4
4
|
// src/version.ts
|
|
5
5
|
var PKG_NAME = "@liveblocks/node";
|
|
6
|
-
var PKG_VERSION = "2.23.
|
|
6
|
+
var PKG_VERSION = "2.23.2";
|
|
7
7
|
var PKG_FORMAT = "cjs";
|
|
8
8
|
|
|
9
9
|
// src/client.ts
|
|
@@ -24,6 +24,7 @@ var PKG_FORMAT = "cjs";
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
+
|
|
27
28
|
// src/lib/itertools.ts
|
|
28
29
|
async function asyncConsume(iterable) {
|
|
29
30
|
const result = [];
|
|
@@ -707,9 +708,12 @@ var Liveblocks = class {
|
|
|
707
708
|
}
|
|
708
709
|
const stream = resp.body.pipeThrough(new TextDecoderStream()).pipeThrough(new LineStream()).pipeThrough(new NdJsonStream());
|
|
709
710
|
const iter = stream[Symbol.asyncIterator]();
|
|
710
|
-
const
|
|
711
|
+
const first = (await iter.next()).value;
|
|
712
|
+
if (!_core.isPlainObject.call(void 0, first) || typeof first.actor !== "number") {
|
|
713
|
+
throw new Error("Failed to obtain a unique session");
|
|
714
|
+
}
|
|
711
715
|
const nodes = await asyncConsume(iter);
|
|
712
|
-
return { actor, nodes };
|
|
716
|
+
return { actor: first.actor, nodes };
|
|
713
717
|
}
|
|
714
718
|
/**
|
|
715
719
|
* Initializes a room’s Storage. The room must already exist and have an empty Storage.
|