Added a way to infer version name from a filename

This commit is contained in:
Kir_Antipov 2024-01-14 22:49:53 +03:00
parent dde2a04f94
commit 3eb68e07b5

View file

@ -415,7 +415,7 @@ export function packModrinthVersionInit(version: ModrinthVersionInit): ModrinthV
...{ ...version, files: undefined }, ...{ ...version, files: undefined },
// Default values // Default values
name: version.name || version.version_number, name: version.name || version.version_number || files[0] && FileInfo.of(files[0]).name,
version_type: version.version_type ?? VersionType.RELEASE, version_type: version.version_type ?? VersionType.RELEASE,
featured: version.featured ?? true, featured: version.featured ?? true,
dependencies: version.dependencies ?? [], dependencies: version.dependencies ?? [],