Skip to content

Commit 668a07a

Browse files
committed
feat(ng-dev): expose convertVersionBranchToSemVer function
The Material infrastructure leveraged this function but we accidentally made it internal as part of the exceptional minor cleanup.
1 parent 9666ef2 commit 668a07a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/local-actions/branch-manager/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63712,14 +63712,14 @@ async function getBranchesForMajorVersions(repo2, majorVersions) {
6371263712
if (!isVersionBranch(name)) {
6371363713
continue;
6371463714
}
63715-
const parsed = getVersionForVersionBranch(name);
63715+
const parsed = convertVersionBranchToSemVer(name);
6371663716
if (parsed !== null && majorVersions.includes(parsed.major)) {
6371763717
branches.push({ name, parsed });
6371863718
}
6371963719
}
6372063720
return branches.sort((a, b) => import_semver.default.rcompare(a.parsed, b.parsed));
6372163721
}
63722-
function getVersionForVersionBranch(branchName) {
63722+
function convertVersionBranchToSemVer(branchName) {
6372363723
return import_semver.default.parse(branchName.replace(versionBranchNameRegex, "$1.$2.0"));
6372463724
}
6372563725

ng-dev/release/versioning/version-branches.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export async function getBranchesForMajorVersions(
113113
}
114114
// Convert the version-branch into a SemVer version that can be used with the
115115
// SemVer utilities. e.g. to determine semantic order, compare versions.
116-
const parsed = getVersionForVersionBranch(name);
116+
const parsed = convertVersionBranchToSemVer(name);
117117
// Collect all version-branches that match the specified major versions.
118118
if (parsed !== null && majorVersions.includes(parsed.major)) {
119119
branches.push({name, parsed});
@@ -131,6 +131,6 @@ export async function getBranchesForMajorVersions(
131131
* For example `10.0.x` will become `10.0.0` in SemVer. The patch digit is not
132132
* relevant but needed for parsing. SemVer does not allow `x` as patch digit.
133133
*/
134-
function getVersionForVersionBranch(branchName: string): semver.SemVer | null {
134+
export function convertVersionBranchToSemVer(branchName: string): semver.SemVer | null {
135135
return semver.parse(branchName.replace(versionBranchNameRegex, '$1.$2.0'));
136136
}

0 commit comments

Comments
 (0)