Skip to content

Commit f28bd41

Browse files
committed
fixup!: use function instead of lambda
1 parent d29d274 commit f28bd41

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

lib/workers/repository/update/branch/auto-replace.ts

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ async function checkExistingBranch(
196196
return existingContent;
197197
}
198198

199+
// check if current !== newString and return 1 if it does or 0 if it doesn't
200+
function updatedToInt(
201+
current: string | undefined,
202+
newString: string | undefined,
203+
): number {
204+
if (current && newString && newString !== current) {
205+
return 1;
206+
} else {
207+
return 0;
208+
}
209+
}
210+
199211
export async function doAutoReplace(
200212
upgrade: BranchUpgradeConfig,
201213
existingContent: string,
@@ -225,11 +237,6 @@ export async function doAutoReplace(
225237
return await checkExistingBranch(upgrade, existingContent);
226238
}
227239

228-
// check if current !== newString and return 1 if it does or 0 if it doesn't
229-
const updatedToInt = (
230-
current: string | undefined,
231-
newString: string | undefined,
232-
): number => (current && newString && newString !== current ? 1 : 0);
233240
// count how many strings need to be updated
234241
const changedCount =
235242
updatedToInt(depName, newName) +

0 commit comments

Comments
 (0)