@dxos/keys 0.8.4-main.84f28bd → 0.8.4-main.c1de068

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/keys",
3
- "version": "0.8.4-main.84f28bd",
3
+ "version": "0.8.4-main.c1de068",
4
4
  "description": "Key utils and definitions.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -27,11 +27,11 @@
27
27
  "src"
28
28
  ],
29
29
  "dependencies": {
30
- "effect": "3.16.13",
30
+ "effect": "3.17.0",
31
31
  "ulidx": "^2.3.0",
32
- "@dxos/invariant": "0.8.4-main.84f28bd",
33
- "@dxos/debug": "0.8.4-main.84f28bd",
34
- "@dxos/node-std": "0.8.4-main.84f28bd"
32
+ "@dxos/debug": "0.8.4-main.c1de068",
33
+ "@dxos/invariant": "0.8.4-main.c1de068",
34
+ "@dxos/node-std": "0.8.4-main.c1de068"
35
35
  },
36
36
  "devDependencies": {
37
37
  "base32-decode": "^1.0.0",
package/src/dxn.ts CHANGED
@@ -6,7 +6,7 @@ import { Schema } from 'effect';
6
6
  import type { inspect, InspectOptionsStylized } from 'node:util';
7
7
 
8
8
  import { devtoolsFormatter, type DevtoolsFormatter, inspectCustom } from '@dxos/debug';
9
- import { invariant } from '@dxos/invariant';
9
+ import { assertArgument, invariant } from '@dxos/invariant';
10
10
 
11
11
  import { ObjectId } from './object-id';
12
12
  import { SpaceId } from './space-id';
@@ -143,6 +143,7 @@ export class DXN {
143
143
  * @example `dxn:echo:@:01J00J9B45YHYSGZQTQMSKMGJ6`
144
144
  */
145
145
  static fromLocalObjectId(id: string): DXN {
146
+ assertArgument(ObjectId.isValid(id), `Invalid object ID: ${id}`);
146
147
  return new DXN(DXN.kind.ECHO, [LOCAL_SPACE_TAG, id]);
147
148
  }
148
149
 
@@ -233,6 +234,7 @@ export class DXN {
233
234
 
234
235
  const [type, version] = this.#parts;
235
236
  return {
237
+ // TODO(wittjosiah): Should be `typename` for consistency.
236
238
  type,
237
239
  version: version as string | undefined,
238
240
  };
package/src/index.ts CHANGED
@@ -7,4 +7,4 @@ export * from './identity-did';
7
7
  export * from './object-id';
8
8
  export * from './public-key';
9
9
  export * from './space-id';
10
- export * from './types';
10
+ export type * from './types';
@@ -4,7 +4,7 @@
4
4
 
5
5
  export const randomBytes = (length: number) => {
6
6
  // globalThis.crypto is not available in Node.js when running in vitest even though the documentation says it should be.
7
- // eslint-disable-next-line @typescript-eslint/no-var-requires
7
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
8
8
  const webCrypto = globalThis.crypto ?? require('node:crypto').webcrypto;
9
9
 
10
10
  const bytes = new Uint8Array(length);