File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 55} from './implementation/checks.js' ;
66import {
77 metaSchema ,
8- nonnegativeNumberSchema ,
98 scorableSchema ,
9+ scoreTargetSchema ,
1010 slugSchema ,
1111 weightedRefSchema ,
1212} from './implementation/schemas.js' ;
@@ -44,12 +44,7 @@ export const categoryConfigSchema = scorableSchema(
4444 description : 'Meta info for category' ,
4545 } ) . shape ,
4646 )
47- . extend ( {
48- scoreTarget : nonnegativeNumberSchema
49- . max ( 1 )
50- . describe ( 'Pass/fail score threshold (0-1)' )
51- . optional ( ) ,
52- } ) ;
47+ . extend ( { scoreTarget : scoreTargetSchema } ) ;
5348
5449export type CategoryConfig = z . infer < typeof categoryConfigSchema > ;
5550
Original file line number Diff line number Diff line change @@ -172,6 +172,12 @@ export function packageVersionSchema<
172172 } > ;
173173}
174174
175+ /** Schema for a binary score threshold */
176+ export const scoreTargetSchema = nonnegativeNumberSchema
177+ . max ( 1 )
178+ . describe ( 'Pass/fail score threshold (0-1)' )
179+ . optional ( ) ;
180+
175181/** Schema for a weight */
176182export const weightSchema = nonnegativeNumberSchema . describe (
177183 'Coefficient for the given score (use weight 0 if only for display)' ,
You can’t perform that action at this time.
0 commit comments