Skip to content

Commit 8b13039

Browse files
committed
feat(models): add isBinary field to category schema
1 parent f52cc75 commit 8b13039

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

packages/models/src/lib/category-config.ts

+19-8
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,25 @@ export const categoryConfigSchema = scorableSchema(
3131
),
3232
getDuplicateRefsInCategoryMetrics,
3333
duplicateRefsInCategoryMetricsErrorMsg,
34-
).merge(
35-
metaSchema({
36-
titleDescription: 'Category Title',
37-
docsUrlDescription: 'Category docs RUL',
38-
descriptionDescription: 'Category description',
39-
description: 'Meta info for category',
40-
}),
41-
);
34+
)
35+
.merge(
36+
metaSchema({
37+
titleDescription: 'Category Title',
38+
docsUrlDescription: 'Category docs RUL',
39+
descriptionDescription: 'Category description',
40+
description: 'Meta info for category',
41+
}),
42+
)
43+
.merge(
44+
z.object({
45+
isBinary: z
46+
.boolean({
47+
description:
48+
'Is this a binary category (i.e. only a perfect score considered a "pass")?',
49+
})
50+
.optional(),
51+
}),
52+
);
4253

4354
export type CategoryConfig = z.infer<typeof categoryConfigSchema>;
4455

0 commit comments

Comments
 (0)