We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecae8af commit d1d283fCopy full SHA for d1d283f
src/content.config.ts
@@ -30,15 +30,11 @@ function defineContent(contentObj: CollectionDefinition) {
30
propComponents: z.array(z.string()).optional(),
31
tab: z.string().optional().default(tabMap[name]),
32
cssPrefix: z
33
- .preprocess((val) => {
34
- if (typeof val === 'string') {
35
- return [val]
36
- }
37
- if (Array.isArray(val)) {
38
- return val
39
40
- return undefined
41
- }, z.array(z.string()))
+ .union([
+ z.string().transform((val) => [val]),
+ z.array(z.string()),
+ z.null().transform(() => undefined),
+ ])
42
.optional(),
43
}),
44
})
0 commit comments