Skip to content

Commit

Permalink
feat(models): add isBinary field to category schema
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Oct 3, 2023
1 parent f52cc75 commit 8b13039
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions packages/models/src/lib/category-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,25 @@ export const categoryConfigSchema = scorableSchema(
),
getDuplicateRefsInCategoryMetrics,
duplicateRefsInCategoryMetricsErrorMsg,
).merge(
metaSchema({
titleDescription: 'Category Title',
docsUrlDescription: 'Category docs RUL',
descriptionDescription: 'Category description',
description: 'Meta info for category',
}),
);
)
.merge(
metaSchema({
titleDescription: 'Category Title',
docsUrlDescription: 'Category docs RUL',
descriptionDescription: 'Category description',
description: 'Meta info for category',
}),
)
.merge(
z.object({
isBinary: z
.boolean({
description:
'Is this a binary category (i.e. only a perfect score considered a "pass")?',
})
.optional(),
}),
);

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

Expand Down

0 comments on commit 8b13039

Please sign in to comment.