fix: support dots in semver prerelease identifier

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2023-10-08 21:48:25 +02:00
parent a2b291294e
commit 85e17bee79

View file

@ -32,7 +32,7 @@ async function parseVersionFromPackageJson(): Promise<ServerVersion> {
const packageInfo = JSON.parse(rawFileContent) as { version: string }; const packageInfo = JSON.parse(rawFileContent) as { version: string };
const versionParts = Optional.ofNullable(packageInfo.version) const versionParts = Optional.ofNullable(packageInfo.version)
.orThrow(() => new Error('No version found in root package.json')) .orThrow(() => new Error('No version found in root package.json'))
.map((version) => /^(\d+).(\d+).(\d+)(?:-(\w+))?$/g.exec(version)) .map((version) => /^(\d+).(\d+).(\d+)(?:-([\w.]+))?$/g.exec(version))
.orElseThrow( .orElseThrow(
() => () =>
new Error( new Error(