@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astrojs/starlight",
3
- "version": "0.26.3",
3
+ "version": "0.26.4",
4
4
  "description": "Build beautiful, high-performance documentation websites with Astro",
5
5
  "keywords": [
6
6
  "docs",
@@ -143,7 +143,8 @@ const errorMap: z.ZodErrorMap = (baseError, ctx) => {
143
143
  };
144
144
 
145
145
  const getTypeOrLiteralMsg = (error: TypeOrLiteralErrByPathEntry): string => {
146
- if (error.received === 'undefined') return 'Required';
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':