File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ _Object containing the following properties:_
130
130
| Property | Description | Type |
131
131
| :---------------- | :----------------------------------------------------------------- | :---------------------------------------------------------------- |
132
132
| ** ` slug ` ** (\* ) | Slug of an audit or group (depending on ` type ` ) | ` string ` (_ regex: ` /^[a-z\d]+(?:-[a-z\d]+)*$/ ` , max length: 128_ ) |
133
- | ** ` weight ` ** (\* ) | Weight used to calculate score | ` number ` (_ int, ≥0_ ) |
133
+ | ** ` weight ` ** (\* ) | Weight used to calculate score | ` number ` (_ ≥0_ ) |
134
134
| ** ` type ` ** (\* ) | Discriminant for reference kind, affects where ` slug ` is looked up | ` 'audit' \| 'group' ` |
135
135
| ** ` plugin ` ** (\* ) | Plugin slug (plugin should contain referenced audit or group) | ` string ` (_ regex: ` /^[a-z\d]+(?:-[a-z\d]+)*$/ ` , max length: 128_ ) |
136
136
@@ -207,7 +207,7 @@ _Object containing the following properties:_
207
207
| Property | Description | Type |
208
208
| :---------------- | :-------------------------------------------------------------- | :---------------------------------------------------------------- |
209
209
| ** ` slug ` ** (\* ) | Reference slug to a group within this plugin (e.g. 'max-lines') | ` string ` (_ regex: ` /^[a-z\d]+(?:-[a-z\d]+)*$/ ` , max length: 128_ ) |
210
- | ** ` weight ` ** (\* ) | Weight used to calculate score | ` number ` (_ int, ≥0_ ) |
210
+ | ** ` weight ` ** (\* ) | Weight used to calculate score | ` number ` (_ ≥0_ ) |
211
211
212
212
_ (\* ) Required._
213
213
Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ export const positiveIntSchema = z.number().int().positive();
119
119
120
120
export const nonnegativeIntSchema = z . number ( ) . int ( ) . nonnegative ( ) ;
121
121
122
+ export const nonnegativeNumberSchema = z . number ( ) . nonnegative ( ) ;
123
+
122
124
export function packageVersionSchema < TRequired extends boolean > ( options ?: {
123
125
versionDescription ?: string ;
124
126
required ?: TRequired ;
@@ -140,7 +142,7 @@ export function packageVersionSchema<TRequired extends boolean>(options?: {
140
142
}
141
143
142
144
/** Schema for a weight */
143
- export const weightSchema = nonnegativeIntSchema . describe (
145
+ export const weightSchema = nonnegativeNumberSchema . describe (
144
146
'Coefficient for the given score (use weight 0 if only for display)' ,
145
147
) ;
146
148
You can’t perform that action at this time.
0 commit comments