mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Revert strict ModInfo.jsonSchema and cover the factorio_version error
The strict major.minor jsonSchema did not improve any consuming type (the factorioVersion field is already typed) and only complicated the fromJSON signature, so revert it (and drop the now-unused MajorMinorVersionSchema). Add a test for the unparseable factorio_version branch in fromJSON. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e27ad5fdf9
commit
5d20f8fc84
3 files changed
+8
-13
No files matched your search
@@ -103,9 +103,6 @@ export function integerPartialVersion(version: PartialVersion) {
|
||||
*/
|
||||
const majorMinorVersionRegExp = /^\d+\.\d+$/;
|
||||
export type MajorMinorVersion = `${number}.${number}`;
|
||||
export const MajorMinorVersionSchema = Type.Unsafe<MajorMinorVersion>(
|
||||
Type.String({ pattern: majorMinorVersionRegExp.source })
|
||||
);
|
||||
|
||||
export function isMajorMinorVersion(input: string): input is MajorMinorVersion {
|
||||
return majorMinorVersionRegExp.test(input);
|
||||
|
||||
Reference in new issue
Block a user