@inixiative/signet 0.4.2 → 0.4.3

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/client.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inixiative/signet",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Present Kingdom Signets: the wire contracts, DPoP proofs, device pairing and a renewing client shared by Kingdom, Archive, Foundry and Oracle.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@biomejs/biome": "2.5.2",
37
- "@inixiative/config": "^0.5.90",
37
+ "@inixiative/config": "^0.5.93",
38
38
  "@types/bun": "1.4.2",
39
39
  "lefthook": "2.1.9",
40
40
  "typescript": "6.0.3",
package/src/client.ts CHANGED
@@ -126,7 +126,8 @@ const errorDetail = async (response: Response) => {
126
126
  try {
127
127
  const body = JSON.parse(text) as { message?: unknown; error?: unknown };
128
128
  const error = body.error as { message?: unknown } | string | undefined;
129
- const message = typeof error === 'string' ? error : (error?.message ?? body.message);
129
+ const errorMessage = typeof error === 'string' ? error : error?.message;
130
+ const message = typeof body.message === 'string' ? body.message : errorMessage;
130
131
  if (typeof message === 'string') return message.slice(0, 500);
131
132
  } catch {}
132
133
  return text.replace(/\s+/g, ' ').slice(0, 500) || undefined;