feat : Con more reaible
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as z from "zod";
|
||||
|
||||
export const lunarisVersionSchema = z.string().regex(/^\d+(?:\.\d+)+$/u);
|
||||
export const catalogFormatVersion = 2;
|
||||
|
||||
export interface LunarisVersionChange {
|
||||
previousVersion: string;
|
||||
@@ -31,3 +32,15 @@ export function compareLunarisVersions(left: string, right: string): number {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
export function catalogSnapshotIsCurrent(
|
||||
requestedVersion: string,
|
||||
currentVersion: string | null,
|
||||
currentFormatVersion: number | null,
|
||||
): boolean {
|
||||
return Boolean(
|
||||
currentVersion &&
|
||||
compareLunarisVersions(requestedVersion, currentVersion) <= 0 &&
|
||||
currentFormatVersion === catalogFormatVersion
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user