MCPcopy Index your code
hub / github.com/code-pushup/cli / validate

Function validate

packages/models/src/lib/implementation/validate.ts:40–50  ·  view source on GitHub ↗
(
  schema: T,
  data: ZodInputLooseAutocomplete<T>,
  context: SchemaValidationContext = {},
)

Source from the content-addressed store, hash-verified

38}
39
40export function validate<T extends ZodType>(
41 schema: T,
42 data: ZodInputLooseAutocomplete<T>,
43 context: SchemaValidationContext = {},
44): z.output<T> {
45 const result = schema.safeParse(data);
46 if (result.success) {
47 return result.data;
48 }
49 throw new SchemaValidationError(result.error, schema, context);
50}
51
52export async function validateAsync<T extends ZodType>(
53 schema: T,

Callers 15

logger-demo.tsFile · 0.90
getLatestCommitFunction · 0.90
loadReportFunction · 0.90
parseOptionsFunction · 0.90
compareReportFilesFunction · 0.90
readRcByPathFunction · 0.90
executePluginRunnerFunction · 0.90
coveragePluginFunction · 0.90
validatePersistFormatFunction · 0.90
coreConfigMiddlewareFunction · 0.90
lighthouseGroupRefsFunction · 0.90
lighthouseAuditRefsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected