mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-27 07:50:47 +00:00
15f4bd8eff
* chore: migrate from zod/v3 to zod/v4 This commit contains the logic changes * chore: migrate imports from zod/v3 to zod/v4 This contains import updates and adds explicit record keys as zod/v4 requires these now * ci: enforce usage of zod/v4
31 lines
641 B
TypeScript
31 lines
641 B
TypeScript
import { z } from 'zod/v4';
|
|
import type { Release } from '../types.ts';
|
|
|
|
export const Homepage = z.string().optional().catch(undefined);
|
|
|
|
export const Repository = z
|
|
.object({
|
|
type: z.literal('git'),
|
|
url: z.string(),
|
|
})
|
|
.transform(({ url }) => url)
|
|
.optional()
|
|
.catch(undefined);
|
|
|
|
export const Versions = z
|
|
.string()
|
|
.transform((version): Release => ({ version }))
|
|
.array();
|
|
|
|
export const Sri = z.record(z.string(), z.string());
|
|
|
|
export const CdnjsAPIVersionResponse = z.object({
|
|
homepage: Homepage,
|
|
repository: Repository,
|
|
versions: Versions,
|
|
});
|
|
|
|
export const CdnjsAPISriResponse = z.object({
|
|
sri: Sri,
|
|
});
|