@evolu/nodejs 3.0.1 → 3.1.0
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/src/TestBundle.js +5 -4
- package/dist/src/TestJSDoc.d.ts +83 -0
- package/dist/src/TestJSDoc.d.ts.map +1 -0
- package/dist/src/TestJSDoc.js +452 -0
- package/dist/src/Worker.d.ts.map +1 -1
- package/dist/src/Worker.js +2 -0
- package/dist/src/local-first/Relay.d.ts.map +1 -1
- package/dist/src/local-first/Relay.js +2 -2
- package/package.json +37 -6
- package/src/TestBundle.ts +5 -4
- package/src/TestJSDoc.ts +820 -0
- package/src/Worker.ts +2 -0
- package/src/local-first/Relay.ts +9 -7
package/src/Worker.ts
CHANGED
|
@@ -14,6 +14,7 @@ export const createBroadcastChannel: CreateBroadcastChannel = <
|
|
|
14
14
|
|
|
15
15
|
disposer.defer(() => {
|
|
16
16
|
disposed = true;
|
|
17
|
+
// oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
|
|
17
18
|
nativeBroadcastChannel.onmessage = null;
|
|
18
19
|
nativeBroadcastChannel.close();
|
|
19
20
|
});
|
|
@@ -31,6 +32,7 @@ export const createBroadcastChannel: CreateBroadcastChannel = <
|
|
|
31
32
|
set onMessage(fn) {
|
|
32
33
|
if (disposed) return;
|
|
33
34
|
onMessageHandler = fn;
|
|
35
|
+
// oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
|
|
34
36
|
nativeBroadcastChannel.onmessage = fn
|
|
35
37
|
? (event: MessageEvent<Output>) => {
|
|
36
38
|
fn(event.data);
|
package/src/local-first/Relay.ts
CHANGED
|
@@ -169,12 +169,11 @@ export const createRelay =
|
|
|
169
169
|
// ignores abort. The daemon runs in the root Run, so aborting the
|
|
170
170
|
// current Run does not make its Fiber wait for the service Promise to
|
|
171
171
|
// settle.
|
|
172
|
-
daemon(
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
),
|
|
172
|
+
daemon(async (run) =>
|
|
173
|
+
tryAsync(
|
|
174
|
+
() => isOwnerAllowed(ownerId, { signal: run.signal }),
|
|
175
|
+
(error) => ({ type: "OwnerAuthorizationError", error }) as const,
|
|
176
|
+
),
|
|
178
177
|
),
|
|
179
178
|
);
|
|
180
179
|
|
|
@@ -287,7 +286,10 @@ export const createRelay =
|
|
|
287
286
|
await once(server, "listening");
|
|
288
287
|
|
|
289
288
|
const address = server.address();
|
|
290
|
-
assert(
|
|
289
|
+
assert(
|
|
290
|
+
address !== null && typeof address !== "string",
|
|
291
|
+
"Expected TCP address",
|
|
292
|
+
);
|
|
291
293
|
|
|
292
294
|
const disposables = disposer.move();
|
|
293
295
|
|