shelving 1.149.1 → 1.149.2

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 +1 -1
  2. package/util/validate.js +4 -2
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "state-management",
12
12
  "query-builder"
13
13
  ],
14
- "version": "1.149.1",
14
+ "version": "1.149.2",
15
15
  "repository": "https://github.com/dhoulb/shelving",
16
16
  "author": "Dave Houlbrooke <dave@shax.com>",
17
17
  "license": "0BSD",
package/util/validate.js CHANGED
@@ -14,8 +14,10 @@ export function getValid(value, validator, ErrorConstructor = ValueError, caller
14
14
  return validator.validate(value);
15
15
  }
16
16
  catch (thrown) {
17
- if (thrown instanceof Feedback)
18
- throw new ErrorConstructor(thrown.message, { received: value, cause: thrown, caller });
17
+ if (thrown instanceof Feedback) {
18
+ const { message, ...rest } = thrown;
19
+ throw new ErrorConstructor(message, { ...rest, cause: thrown, caller });
20
+ }
19
21
  throw thrown;
20
22
  }
21
23
  }