Skip to content

Commit

Permalink
semantic coercion no removes illegal leading 0's
Browse files Browse the repository at this point in the history
  • Loading branch information
IDCs committed Oct 21, 2024
1 parent 4487ce8 commit f29cdfc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/extensions/mod_management/util/testModReference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export function coerceToSemver(version: string): string {
}
} else {
if (coerceableRE.test(version)) {
const coerced = semver.coerce(version);
// Remove leading 0's from the version segments as that's
// an illegal semantic versioning format/pattern
const sanitizedVersion = version.replace(/\b0+(\d)/g, '$1');
const coerced = semver.coerce(sanitizedVersion);
if (coerced) {
return coerced.version
}
Expand Down

0 comments on commit f29cdfc

Please sign in to comment.