Skip to content

Commit 45df3c1

Browse files
committed
CR feedback
1 parent 23a8de3 commit 45df3c1

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/tools/UpdatePackageDependencies.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ export async function updatePackageDependencies(): Promise<void> {
8181
for (let urlToUpdate of newPrimaryUrlArray) {
8282
const dependency = findDependencyToUpdate(urlToUpdate);
8383
//Fallback url should contain a version
84-
verifyMatchCount(dependency.fallbackUrl, true);
85-
verifyMatchCount(dependency.installPath);
86-
verifyMatchCount(dependency.installTestPath);
84+
verifyVersionSubstringCount(dependency.fallbackUrl, true);
85+
verifyVersionSubstringCount(dependency.installPath);
86+
verifyVersionSubstringCount(dependency.installTestPath);
8787
}
8888

8989
// Next take another pass to try and update to the URL
@@ -138,27 +138,27 @@ export async function updatePackageDependencies(): Promise<void> {
138138
}
139139

140140

141-
function replaceVersion(value: string, newVersion: string): string {
142-
if (!value) {
143-
return value; //if the value is null or undefined return the same one
141+
function replaceVersion(fileName: string, newVersion: string): string {
142+
if (!fileName) {
143+
return fileName; //if the value is null or undefined return the same one
144144
}
145145

146146
let regex: RegExp = dottedVersionRegExp;
147147
let newValue: string = newVersion;
148-
if (!dottedVersionRegExp.test(value)) {
148+
if (!dottedVersionRegExp.test(fileName)) {
149149
regex = dashedVersionRegExp;
150150
newValue = newVersion.replace(/\./g, "-");
151151
}
152152
dottedVersionRegExp.lastIndex = 0;
153153

154-
if (!regex.test(value)) {
155-
return value; //If the string doesn't contain any version return the same string
154+
if (!regex.test(fileName)) {
155+
return fileName; //If the string doesn't contain any version return the same string
156156
}
157157

158-
return value.replace(regex, newValue);
158+
return fileName.replace(regex, newValue);
159159
}
160160

161-
function verifyMatchCount(value: string, shouldContainVersion = false): void {
161+
function verifyVersionSubstringCount(value: string, shouldContainVersion = false): void {
162162
const getMatchCount = (regexp: RegExp, searchString: string): number => {
163163
regexp.lastIndex = 0;
164164
let retVal = 0;

0 commit comments

Comments
 (0)