@code-pushup/models 0.44.4 → 0.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +3 -2
- package/package.json +1 -1
- package/src/lib/implementation/schemas.d.ts +1 -0
package/index.js
CHANGED
|
@@ -107,6 +107,7 @@ var fileNameSchema = z.string().trim().regex(filenameRegex, {
|
|
|
107
107
|
}).min(1, { message: "file name is invalid" });
|
|
108
108
|
var positiveIntSchema = z.number().int().positive();
|
|
109
109
|
var nonnegativeIntSchema = z.number().int().nonnegative();
|
|
110
|
+
var nonnegativeNumberSchema = z.number().nonnegative();
|
|
110
111
|
function packageVersionSchema(options) {
|
|
111
112
|
const { versionDescription = "NPM version of the package", required } = options ?? {};
|
|
112
113
|
const packageSchema = z.string({ description: "NPM package name" });
|
|
@@ -119,7 +120,7 @@ function packageVersionSchema(options) {
|
|
|
119
120
|
{ description: "NPM package name and version of a published package" }
|
|
120
121
|
);
|
|
121
122
|
}
|
|
122
|
-
var weightSchema =
|
|
123
|
+
var weightSchema = nonnegativeNumberSchema.describe(
|
|
123
124
|
"Coefficient for the given score (use weight 0 if only for display)"
|
|
124
125
|
);
|
|
125
126
|
function weightedRefSchema(description, slugDescription) {
|
|
@@ -262,7 +263,7 @@ var tableObjectSchema = tableSharedSchema.merge(
|
|
|
262
263
|
var tableSchema = (description = "Table information") => z4.union([tablePrimitiveSchema, tableObjectSchema], { description });
|
|
263
264
|
|
|
264
265
|
// packages/models/src/lib/audit-output.ts
|
|
265
|
-
var auditValueSchema =
|
|
266
|
+
var auditValueSchema = nonnegativeNumberSchema.describe("Raw numeric value");
|
|
266
267
|
var auditDisplayValueSchema = z5.string({ description: "Formatted value (e.g. '0.9 s', '2.1 MB')" }).optional();
|
|
267
268
|
var auditDetailsSchema = z5.object(
|
|
268
269
|
{
|
package/package.json
CHANGED
|
@@ -57,6 +57,7 @@ export declare const fileNameSchema: ZodString;
|
|
|
57
57
|
/** Schema for a positiveInt */
|
|
58
58
|
export declare const positiveIntSchema: z.ZodNumber;
|
|
59
59
|
export declare const nonnegativeIntSchema: z.ZodNumber;
|
|
60
|
+
export declare const nonnegativeNumberSchema: z.ZodNumber;
|
|
60
61
|
export declare function packageVersionSchema<TRequired extends boolean>(options?: {
|
|
61
62
|
versionDescription?: string;
|
|
62
63
|
required?: TRequired;
|