@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/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);
@@ -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
- async (run) =>
174
- await tryAsync(
175
- () => isOwnerAllowed(ownerId, { signal: run.signal }),
176
- (error) => ({ type: "OwnerAuthorizationError", error }) as const,
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(address && typeof address !== "string", "Expected TCP address");
289
+ assert(
290
+ address !== null && typeof address !== "string",
291
+ "Expected TCP address",
292
+ );
291
293
 
292
294
  const disposables = disposer.move();
293
295