mirror of
https://github.com/penpot/penpot-export.git
synced 2025-01-19 21:22:28 -05:00
chore(core): disallow empty arrays in user config
This commit is contained in:
parent
83ba6f93d5
commit
f7b972e032
1 changed files with 15 additions and 3 deletions
|
@ -49,9 +49,21 @@ const userPagesConfigSchema = z.object({
|
|||
const userFileConfigSchema = z
|
||||
.object({
|
||||
fileId: fileIdSchema,
|
||||
colors: z.optional(z.array(userColorsConfigSchema)),
|
||||
typographies: z.optional(z.array(userTypographiesConfigSchema)),
|
||||
pages: z.optional(z.array(userPagesConfigSchema)),
|
||||
colors: z.optional(
|
||||
z
|
||||
.array(userColorsConfigSchema)
|
||||
.nonempty({ message: '.colors is required to have at least one item' }),
|
||||
),
|
||||
typographies: z.optional(
|
||||
z.array(userTypographiesConfigSchema).nonempty({
|
||||
message: '.typographies is required to have at least one item',
|
||||
}),
|
||||
),
|
||||
pages: z.optional(
|
||||
z
|
||||
.array(userPagesConfigSchema)
|
||||
.nonempty({ message: '.pages is required to have at least one item' }),
|
||||
),
|
||||
})
|
||||
.refine(
|
||||
(object) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue