monitor/core/lib/fxserver/fxsVersionParser.ts
2025-04-16 22:30:27 +07:00

26 lines
558 B
TypeScript

/**
* Parses a fxserver version convar into a number.
*/
export const parseFxserverVersion = (version: any): ParseFxserverVersionResult => {
if (typeof version !== 'string') throw new Error(`expected string`);
return {
valid: true,
branch: "master",
build: 9999,
platform: "windows",
}
};
type ParseFxserverVersionResult = {
valid: true;
branch: string;
build: number;
platform: string;
} | {
valid: false;
branch: null;
build: null;
platform: 'windows' | 'linux' | null;
};