mirror of
https://github.com/penpot/penpot-export.git
synced 2025-02-01 03:38:51 -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
|
const userFileConfigSchema = z
|
||||||
.object({
|
.object({
|
||||||
fileId: fileIdSchema,
|
fileId: fileIdSchema,
|
||||||
colors: z.optional(z.array(userColorsConfigSchema)),
|
colors: z.optional(
|
||||||
typographies: z.optional(z.array(userTypographiesConfigSchema)),
|
z
|
||||||
pages: z.optional(z.array(userPagesConfigSchema)),
|
.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(
|
.refine(
|
||||||
(object) => {
|
(object) => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue