shelving 1.160.2 → 1.160.4

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
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.160.2",
14
+ "version": "1.160.4",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
package/util/data.d.ts CHANGED
@@ -6,6 +6,10 @@ import type { DeepPartial } from "./object.js";
6
6
  export type Data = {
7
7
  readonly [K in string]: unknown;
8
8
  };
9
+ /** Partial data object (values can be explicitly `undefined`). */
10
+ export type PartialData<T extends Data> = {
11
+ readonly [K in keyof T]?: T[K] | undefined;
12
+ };
9
13
  /** Key for a data object prop. */
10
14
  export type DataKey<T extends Data> = keyof T & string;
11
15
  /** Value for a data object prop. */
package/util/http.js CHANGED
@@ -9,16 +9,16 @@ export async function _getMessageJSON(message, MessageError, caller) {
9
9
  try {
10
10
  return JSON.parse(trimmed);
11
11
  }
12
- catch {
13
- throw new MessageError("Body must be valid JSON", { received: trimmed, caller });
12
+ catch (cause) {
13
+ throw new MessageError("Body must be valid JSON", { received: trimmed, cause, caller });
14
14
  }
15
15
  }
16
16
  export async function _getMessageFormData(message, MessageError, caller) {
17
17
  try {
18
18
  return await message.formData();
19
19
  }
20
- catch {
21
- throw new MessageError("Body must be valid valid form multipart data", { caller });
20
+ catch (cause) {
21
+ throw new MessageError(`Body must be valid form multipart data`, { cause, caller });
22
22
  }
23
23
  }
24
24
  export function _getMessageContent(message, MessageError, caller) {