@evolu/web 3.0.2 → 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.
@@ -1,4 +1,6 @@
1
1
  import { PositiveInt, type ReloadApp } from "@evolu/common";
2
+ /** Returns true when the browser runs on an Apple platform. */
3
+ export declare const isApplePlatform: () => boolean;
2
4
  /** Returns the amount of logical processors available to the browser. */
3
5
  export declare const availableParallelism: () => PositiveInt;
4
6
  export declare const reloadApp: ReloadApp;
@@ -1 +1 @@
1
- {"version":3,"file":"Platform.d.ts","sourceRoot":"","sources":["../../src/Platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE5D,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,QAAO,WACuB,CAAC;AAEhE,eAAO,MAAM,SAAS,EAAE,SAMvB,CAAC"}
1
+ {"version":3,"file":"Platform.d.ts","sourceRoot":"","sources":["../../src/Platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE5D,+DAA+D;AAC/D,eAAO,MAAM,eAAe,QAAO,OAMlC,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,oBAAoB,QAAO,WACuB,CAAC;AAEhE,eAAO,MAAM,SAAS,EAAE,SAMvB,CAAC"}
@@ -1,4 +1,10 @@
1
1
  import { PositiveInt } from "@evolu/common";
2
+ /** Returns true when the browser runs on an Apple platform. */
3
+ export const isApplePlatform = () => {
4
+ const platform = globalThis.navigator.userAgentData?.platform ??
5
+ globalThis.navigator.platform;
6
+ return /^(?:Mac|iPhone|iPad|iPod)/iu.test(platform);
7
+ };
2
8
  /** Returns the amount of logical processors available to the browser. */
3
9
  export const availableParallelism = () => PositiveInt.orThrow(globalThis.navigator.hardwareConcurrency);
4
10
  export const reloadApp = (url) => {
@@ -1 +1 @@
1
- {"version":3,"file":"Sqlite.d.ts","sourceRoot":"","sources":["../../src/Sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAa,MAAM,eAAe,CAAC;AA4BnE,eAAO,MAAM,sBAAsB,EAAE,kBA6GlC,CAAC"}
1
+ {"version":3,"file":"Sqlite.d.ts","sourceRoot":"","sources":["../../src/Sqlite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAa,MAAM,eAAe,CAAC;AAiCnE,eAAO,MAAM,sBAAsB,EAAE,kBAoHlC,CAAC"}
@@ -50,7 +50,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
50
50
  var e = new Error(message);
51
51
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
52
  });
53
- import { bytesToHex, createPreparedStatementsCache, ok } from "@evolu/common";
53
+ import { bytesToHex, createPreparedStatementsCache, exhaustiveCheck, ok, } from "@evolu/common";
54
54
  import sqlite3InitModule, {} from "@evolu/sqlite-wasm";
55
55
  // @ts-expect-error Missing types.
56
56
  globalThis.sqlite3ApiConfig = {
@@ -90,6 +90,7 @@ export const createWasmSqliteDriver = (name, options) => async () => {
90
90
  let db;
91
91
  switch (options?.mode) {
92
92
  case "memory":
93
+ // oxlint-disable-next-line react/rules-of-hooks -- useDatabase registers disposal and is not a React Hook.
93
94
  db = useDatabase(new sqlite3.oo1.DB(":memory:"));
94
95
  break;
95
96
  case "encrypted": {
@@ -100,6 +101,7 @@ export const createWasmSqliteDriver = (name, options) => async () => {
100
101
  const pool = await createOpfsSAHPoolVfs({
101
102
  directory: `.${name}`,
102
103
  });
104
+ // oxlint-disable-next-line react/rules-of-hooks -- useDatabase registers disposal and is not a React Hook.
103
105
  db = useDatabase(new pool.OpfsSAHPoolDb(
104
106
  // SQLite normalizes this URI filename to SAH-pool path "/evolu1.db".
105
107
  `file:${fileName}?vfs=multipleciphers-opfs-sahpool`));
@@ -109,10 +111,14 @@ export const createWasmSqliteDriver = (name, options) => async () => {
109
111
  `);
110
112
  break;
111
113
  }
112
- default: {
114
+ case undefined: {
113
115
  const pool = await createOpfsSAHPoolVfs({ name });
116
+ // oxlint-disable-next-line react/rules-of-hooks -- useDatabase registers disposal and is not a React Hook.
114
117
  db = useDatabase(new pool.OpfsSAHPoolDb(`file:${fileName}`));
118
+ break;
115
119
  }
120
+ default:
121
+ exhaustiveCheck(options);
116
122
  }
117
123
  const cache = disposer.use(createPreparedStatementsCache((sql) => db.prepare(sql), (statement) => {
118
124
  statement.finalize();
@@ -1 +1 @@
1
- {"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../../src/Worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EAGd,YAAY,EACZ,gBAAgB,EAEhB,MAAM,EACN,UAAU,EACV,UAAU,EACX,MAAM,eAAe,CAAC;AAQvB,kDAAkD;AAClD,eAAO,MAAM,YAAY,GAAI,KAAK,EAAE,MAAM,gBAC1B,UAAU,CAAC,MAAM,KAC9B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAuB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,QAAO,IAiBpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,sBAClC,UAAU,CAAC,YAAY,KAC1C,YAAY,CAAC,KAAK,EAAE,MAAM,CAM5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,OAAK,cAAc,CAC3E,KAAK,EACL,MAAM,CAcP,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBACuB,CAAC;AAExD,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,sBAsCpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,cACxC,UAAU,CAAC,0BAA0B,KAChD,UAAU,CAAC,KAAK,EAAE,MAAM,CAAoC,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,cAC9C,UAAU,CAAC,uBAAuB,KAC7C,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAkBhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,cAC5D,UAAU,CAAC,0BAA0B,KAChD,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAyEhC,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,QAAO,UAAU,GAC5C,yBAAyB,GACzB,uBAWD,CAAC"}
1
+ {"version":3,"file":"Worker.d.ts","sourceRoot":"","sources":["../../src/Worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,iBAAiB,EACjB,cAAc,EAGd,YAAY,EACZ,gBAAgB,EAEhB,MAAM,EACN,UAAU,EACV,UAAU,EACX,MAAM,eAAe,CAAC;AAQvB,kDAAkD;AAClD,eAAO,MAAM,YAAY,GAAI,KAAK,EAAE,MAAM,gBAC1B,UAAU,CAAC,MAAM,KAC9B,MAAM,CAAC,KAAK,EAAE,MAAM,CAAuB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,QAAO,IAiBpD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,sBAClC,UAAU,CAAC,YAAY,KAC1C,YAAY,CAAC,KAAK,EAAE,MAAM,CAM5B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,OAAK,cAAc,CAC3E,KAAK,EACL,MAAM,CAcP,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,EAAE,iBACuB,CAAC;AAExD,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,sBAwCpC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,cACxC,UAAU,CAAC,0BAA0B,KAChD,UAAU,CAAC,KAAK,EAAE,MAAM,CAAoC,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,cAC9C,UAAU,CAAC,uBAAuB,KAC7C,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAoBhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC,GAAI,KAAK,EAAE,MAAM,GAAG,KAAK,cAC5D,UAAU,CAAC,0BAA0B,KAChD,gBAAgB,CAAC,KAAK,EAAE,MAAM,CA2EhC,CAAC;AAEF,sDAAsD;AACtD,eAAO,MAAM,gBAAgB,QAAO,UAAU,GAC5C,yBAAyB,GACzB,uBAWD,CAAC"}
@@ -50,7 +50,7 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
50
50
  var e = new Error(message);
51
51
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
52
52
  });
53
- import { assert, createConsole, createConsoleStoreOutput, disposable, } from "@evolu/common";
53
+ import { assertNonNullable, createConsole, createConsoleStoreOutput, disposable, } from "@evolu/common";
54
54
  /** Creates a {@link Worker} from a Web Worker. */
55
55
  export const createWorker = (nativeWorker) => wrap(nativeWorker);
56
56
  /**
@@ -134,6 +134,7 @@ export const createBroadcastChannel = (name) => {
134
134
  let disposed = false;
135
135
  disposer.defer(() => {
136
136
  disposed = true;
137
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
137
138
  nativeBroadcastChannel.onmessage = null;
138
139
  nativeBroadcastChannel.close();
139
140
  });
@@ -149,6 +150,7 @@ export const createBroadcastChannel = (name) => {
149
150
  if (disposed)
150
151
  return;
151
152
  onMessageHandler = fn;
153
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
152
154
  nativeBroadcastChannel.onmessage = fn
153
155
  ? (event) => {
154
156
  fn(event.data);
@@ -180,12 +182,14 @@ export const createSharedWorkerSelf = (nativeSelf) => {
180
182
  const self = {
181
183
  onConnect: null,
182
184
  [Symbol.dispose]: () => {
185
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
183
186
  nativeSelf.onconnect = null;
184
187
  nativeSelf.close();
185
188
  },
186
189
  };
190
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
187
191
  nativeSelf.onconnect = (e) => {
188
- assert(self.onConnect != null, "onConnect must be set before receiving connections");
192
+ assertNonNullable(self.onConnect, "onConnect must be set before receiving connections");
189
193
  self.onConnect(wrap(e.ports[0]));
190
194
  };
191
195
  return self;
@@ -209,10 +213,12 @@ export const createOneTabSharedWorkerSelfPolyfill = (nativeSelf) => {
209
213
  messages.length = 0;
210
214
  onConnectHandler = null;
211
215
  onMessageHandler = null;
216
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
212
217
  nativeSelf.onmessage = null;
213
218
  nativeSelf.close();
214
219
  });
215
220
  const disposables = disposer.move();
221
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
216
222
  nativeSelf.onmessage = (event) => {
217
223
  if (disposables.disposed)
218
224
  return;
@@ -307,16 +313,19 @@ const wrap = (native) => {
307
313
  onMessageHandler = fn;
308
314
  if (fn) {
309
315
  // Messages are queued until onMessage is assigned.
316
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
310
317
  native.onmessage = (event) => {
311
318
  fn(event.data);
312
319
  };
313
320
  }
314
321
  else {
322
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
315
323
  native.onmessage = null;
316
324
  }
317
325
  },
318
326
  native: native,
319
327
  [Symbol.dispose]: () => {
328
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
320
329
  native.onmessage = null;
321
330
  if ("terminate" in native)
322
331
  native.terminate();
@@ -1,5 +1,5 @@
1
1
  export * from "./local-first/index.ts";
2
- export { availableParallelism } from "./Platform.ts";
2
+ export { availableParallelism, isApplePlatform } from "./Platform.ts";
3
3
  export * from "./Sqlite.ts";
4
4
  export * from "./Task.ts";
5
5
  export * from "./Worker.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACtE,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./local-first/index.js";
2
- export { availableParallelism } from "./Platform.js";
2
+ export { availableParallelism, isApplePlatform } from "./Platform.js";
3
3
  export * from "./Sqlite.js";
4
4
  export * from "./Task.js";
5
5
  export * from "./Worker.js";
@@ -124,9 +124,12 @@ const createCredentialCreationOptions = (deps) => (username, seed, relyingPartyI
124
124
  displayName: username,
125
125
  },
126
126
  pubKeyCredParams: [
127
- { type: "public-key", alg: -8 }, // Ed25519
128
- { type: "public-key", alg: -7 }, // ES256
129
- { type: "public-key", alg: -257 }, // RS256
127
+ // Ed25519
128
+ { type: "public-key", alg: -8 },
129
+ // ES256
130
+ { type: "public-key", alg: -7 },
131
+ // RS256
132
+ { type: "public-key", alg: -257 },
130
133
  ],
131
134
  attestation: "none",
132
135
  authenticatorSelection: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evolu/web",
3
- "version": "3.0.2",
3
+ "version": "3.1.0",
4
4
  "description": "Evolu for web",
5
5
  "keywords": [
6
6
  "evolu",
@@ -40,7 +40,7 @@
40
40
  "@types/web-locks-api": "^0.0.5",
41
41
  "@typescript/native": "npm:typescript@^7.0.2",
42
42
  "user-agent-data-types": "^0.4.2",
43
- "@evolu/common": "8.3.0",
43
+ "@evolu/common": "8.5.0",
44
44
  "@evolu/typescript-config": "0.0.2"
45
45
  },
46
46
  "peerDependencies": {
package/src/Platform.ts CHANGED
@@ -1,5 +1,14 @@
1
1
  import { PositiveInt, type ReloadApp } from "@evolu/common";
2
2
 
3
+ /** Returns true when the browser runs on an Apple platform. */
4
+ export const isApplePlatform = (): boolean => {
5
+ const platform =
6
+ globalThis.navigator.userAgentData?.platform ??
7
+ globalThis.navigator.platform;
8
+
9
+ return /^(?:Mac|iPhone|iPad|iPod)/iu.test(platform);
10
+ };
11
+
3
12
  /** Returns the amount of logical processors available to the browser. */
4
13
  export const availableParallelism = (): PositiveInt =>
5
14
  PositiveInt.orThrow(globalThis.navigator.hardwareConcurrency);
package/src/Sqlite.ts CHANGED
@@ -1,5 +1,10 @@
1
1
  import type { CreateSqliteDriver, SqliteRow } from "@evolu/common";
2
- import { bytesToHex, createPreparedStatementsCache, ok } from "@evolu/common";
2
+ import {
3
+ bytesToHex,
4
+ createPreparedStatementsCache,
5
+ exhaustiveCheck,
6
+ ok,
7
+ } from "@evolu/common";
3
8
  import sqlite3InitModule, {
4
9
  type Database,
5
10
  type PreparedStatement,
@@ -53,6 +58,7 @@ export const createWasmSqliteDriver: CreateSqliteDriver =
53
58
 
54
59
  switch (options?.mode) {
55
60
  case "memory":
61
+ // oxlint-disable-next-line react/rules-of-hooks -- useDatabase registers disposal and is not a React Hook.
56
62
  db = useDatabase(new sqlite3.oo1.DB(":memory:"));
57
63
  break;
58
64
 
@@ -64,6 +70,7 @@ export const createWasmSqliteDriver: CreateSqliteDriver =
64
70
  const pool = await createOpfsSAHPoolVfs({
65
71
  directory: `.${name}`,
66
72
  });
73
+ // oxlint-disable-next-line react/rules-of-hooks -- useDatabase registers disposal and is not a React Hook.
67
74
  db = useDatabase(
68
75
  new pool.OpfsSAHPoolDb(
69
76
  // SQLite normalizes this URI filename to SAH-pool path "/evolu1.db".
@@ -77,10 +84,15 @@ export const createWasmSqliteDriver: CreateSqliteDriver =
77
84
  break;
78
85
  }
79
86
 
80
- default: {
87
+ case undefined: {
81
88
  const pool = await createOpfsSAHPoolVfs({ name });
89
+ // oxlint-disable-next-line react/rules-of-hooks -- useDatabase registers disposal and is not a React Hook.
82
90
  db = useDatabase(new pool.OpfsSAHPoolDb(`file:${fileName}`));
91
+ break;
83
92
  }
93
+
94
+ default:
95
+ exhaustiveCheck(options);
84
96
  }
85
97
 
86
98
  const cache = disposer.use(
package/src/Worker.ts CHANGED
@@ -15,7 +15,7 @@ import type {
15
15
  WorkerSelf,
16
16
  } from "@evolu/common";
17
17
  import {
18
- assert,
18
+ assertNonNullable,
19
19
  createConsole,
20
20
  createConsoleStoreOutput,
21
21
  disposable,
@@ -117,6 +117,7 @@ export const createBroadcastChannel: CreateBroadcastChannel = <
117
117
 
118
118
  disposer.defer(() => {
119
119
  disposed = true;
120
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
120
121
  nativeBroadcastChannel.onmessage = null;
121
122
  nativeBroadcastChannel.close();
122
123
  });
@@ -134,6 +135,7 @@ export const createBroadcastChannel: CreateBroadcastChannel = <
134
135
  set onMessage(fn) {
135
136
  if (disposed) return;
136
137
  onMessageHandler = fn;
138
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
137
139
  nativeBroadcastChannel.onmessage = fn
138
140
  ? (event: MessageEvent<Output>) => {
139
141
  fn(event.data);
@@ -165,14 +167,16 @@ export const createSharedWorkerSelf = <Input, Output = never>(
165
167
  const self: SharedWorkerSelf<Input, Output> = {
166
168
  onConnect: null,
167
169
  [Symbol.dispose]: () => {
170
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
168
171
  nativeSelf.onconnect = null;
169
172
  nativeSelf.close();
170
173
  },
171
174
  };
172
175
 
176
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
173
177
  nativeSelf.onconnect = (e) => {
174
- assert(
175
- self.onConnect != null,
178
+ assertNonNullable(
179
+ self.onConnect,
176
180
  "onConnect must be set before receiving connections",
177
181
  );
178
182
  self.onConnect(wrap<Output, Input>(e.ports[0]));
@@ -203,12 +207,14 @@ export const createOneTabSharedWorkerSelfPolyfill = <Input, Output = never>(
203
207
  messages.length = 0;
204
208
  onConnectHandler = null;
205
209
  onMessageHandler = null;
210
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
206
211
  nativeSelf.onmessage = null;
207
212
  nativeSelf.close();
208
213
  });
209
214
 
210
215
  const disposables = disposer.move();
211
216
 
217
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
212
218
  nativeSelf.onmessage = (event: MessageEvent<Input>) => {
213
219
  if (disposables.disposed) return;
214
220
 
@@ -300,10 +306,12 @@ const wrap = <Input, Output>(
300
306
  onMessageHandler = fn;
301
307
  if (fn) {
302
308
  // Messages are queued until onMessage is assigned.
309
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
303
310
  native.onmessage = (event: MessageEvent<Output>) => {
304
311
  fn(event.data);
305
312
  };
306
313
  } else {
314
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
307
315
  native.onmessage = null;
308
316
  }
309
317
  },
@@ -311,6 +319,7 @@ const wrap = <Input, Output>(
311
319
  native: native as unknown as NativeMessagePort<Input, Output>,
312
320
 
313
321
  [Symbol.dispose]: () => {
322
+ // oxlint-disable-next-line unicorn/prefer-add-event-listener -- This adapter owns and clears one handler.
314
323
  native.onmessage = null;
315
324
  if ("terminate" in native) native.terminate();
316
325
  else native.close();
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "./local-first/index.ts";
2
- export { availableParallelism } from "./Platform.ts";
2
+ export { availableParallelism, isApplePlatform } from "./Platform.ts";
3
3
  export * from "./Sqlite.ts";
4
4
  export * from "./Task.ts";
5
5
  export * from "./Worker.ts";
@@ -226,9 +226,12 @@ const createCredentialCreationOptions =
226
226
  displayName: username,
227
227
  },
228
228
  pubKeyCredParams: [
229
- { type: "public-key", alg: -8 }, // Ed25519
230
- { type: "public-key", alg: -7 }, // ES256
231
- { type: "public-key", alg: -257 }, // RS256
229
+ // Ed25519
230
+ { type: "public-key", alg: -8 },
231
+ // ES256
232
+ { type: "public-key", alg: -7 },
233
+ // RS256
234
+ { type: "public-key", alg: -257 },
232
235
  ],
233
236
  attestation: "none",
234
237
  authenticatorSelection: {