Skip to content

Commit d1d283f

Browse files
committed
Fix error
1 parent ecae8af commit d1d283f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/content.config.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ function defineContent(contentObj: CollectionDefinition) {
3030
propComponents: z.array(z.string()).optional(),
3131
tab: z.string().optional().default(tabMap[name]),
3232
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()))
33+
.union([
34+
z.string().transform((val) => [val]),
35+
z.array(z.string()),
36+
z.null().transform(() => undefined),
37+
])
4238
.optional(),
4339
}),
4440
})

0 commit comments

Comments
 (0)