@astrojs/starlight 0.26.3 → 0.26.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/utils/error-map.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.26.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2288](https://github.com/withastro/starlight/pull/2288) [`b15f725`](https://github.com/withastro/starlight/commit/b15f725ead981387f80f089d0523d9c2748b184e) Thanks [@matthewp](https://github.com/matthewp)! - Safely handle Zod errors
|
|
8
|
+
|
|
9
|
+
Prevents bugs where errors without the `.received` props would through and cause builds to fail unnecessarily.
|
|
10
|
+
|
|
3
11
|
## 0.26.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/package.json
CHANGED
package/utils/error-map.ts
CHANGED
|
@@ -143,7 +143,8 @@ const errorMap: z.ZodErrorMap = (baseError, ctx) => {
|
|
|
143
143
|
};
|
|
144
144
|
|
|
145
145
|
const getTypeOrLiteralMsg = (error: TypeOrLiteralErrByPathEntry): string => {
|
|
146
|
-
|
|
146
|
+
// received could be `undefined` or the string `'undefined'`
|
|
147
|
+
if (typeof error.received === 'undefined' || error.received === 'undefined') return 'Required';
|
|
147
148
|
const expectedDeduped = new Set(error.expected);
|
|
148
149
|
switch (error.code) {
|
|
149
150
|
case 'invalid_type':
|