mirror of
https://github.com/renovatebot/renovate.git
synced 2026-11-02 02:29:51 +00:00
914c64afbd
* ci: add linting rule for schema and infered types * refactor: remove usages of Schema and differently named types
22 lines
687 B
TypeScript
22 lines
687 B
TypeScript
import { z } from 'zod/v4';
|
|
import { asTimestamp } from '../../../util/timestamp.ts';
|
|
import type { ReleaseResult } from '../types.ts';
|
|
|
|
/**
|
|
* Response from package.elm-lang.org/packages/{author}/{package}/releases.json
|
|
* Maps version strings to Unix timestamps
|
|
*/
|
|
export const ElmPackageReleases = z
|
|
.record(z.string(), z.number())
|
|
.refine((obj) => Object.keys(obj).length > 0, 'No releases found')
|
|
.transform((releases): ReleaseResult => {
|
|
return {
|
|
releases: Object.entries(releases).map(([version, timestamp]) => ({
|
|
version,
|
|
releaseTimestamp: asTimestamp(timestamp),
|
|
})),
|
|
};
|
|
});
|
|
|
|
export type ElmPackageReleases = Record<string, number>;
|