diff --git a/src/utils/version-utils.ts b/src/utils/version-utils.ts index b8def7e..1f71da4 100644 --- a/src/utils/version-utils.ts +++ b/src/utils/version-utils.ts @@ -1,14 +1,20 @@ +export enum VersionType { + Alpha = "alpha", + Beta = "beta", + Release = "release", +} + export function parseVersionFromName(name: string): string { const match = name.match(/[a-z]{0,2}\d+\.\d+.*/i); return match ? match[0] : name; } -export function parseVersionTypeFromName(name: string): "alpha" | "beta" | "release" { +export function parseVersionTypeFromName(name: string): VersionType { if (name.match(/[+-_]alpha/i)) { - return "alpha"; + return VersionType.Alpha; } else if (name.match(/[+-_]beta/i)) { - return "beta"; + return VersionType.Beta; } else { - return "release"; + return VersionType.Release; } }