mirror of
https://github.com/renovatebot/renovate.git
synced 2024-12-22 13:38:32 +00:00
8fb2a6b9d2
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
31 lines
635 B
TypeScript
31 lines
635 B
TypeScript
import { z } from 'zod';
|
|
import type { Release } from '../types';
|
|
|
|
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());
|
|
|
|
export const CdnjsAPIVersionResponseSchema = z.object({
|
|
homepage: Homepage,
|
|
repository: Repository,
|
|
versions: Versions,
|
|
});
|
|
|
|
export const CdnjsAPISriResponseSchema = z.object({
|
|
sri: Sri,
|
|
});
|