Skip to content

Commit

Permalink
Don't specify default type arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Dec 17, 2024
1 parent 7ba07f5 commit f48e1eb
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions src/goals/MergeDuplicates/MergeDupsStep/protectReasonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,17 @@ interface WordSenseReasons {
}

export function protectReasonsText(
t: TFunction<"translation", undefined>,
t: TFunction,
reasons: WordSenseReasons
): string {
const wordTexts = reasons.word?.map((r) => wordReasonText(t, r)) ?? [];
const senseTexts = reasons.sense?.map((r) => senseReasonText(t, r)) ?? [];
const val = [...wordTexts, ...senseTexts].join(sep);
return t("mergeDups.helpText.protectedData", { val });
const wordTexts = reasons.word?.map((r) => wordReasonText(t, r));
const senseTexts = reasons.sense?.map((r) => senseReasonText(t, r));
const allTexts = [...(wordTexts ?? []), ...(senseTexts ?? [])];
return t("mergeDups.helpText.protectedData", { val: allTexts.join(sep) });
}

/** Cases match Backend/Helper/LiftHelper.cs > GetProtectedReasons(LiftSense sense) */
function senseReasonText(
t: TFunction<"translation", undefined>,
reason: ProtectReason
): string {
function senseReasonText(t: TFunction, reason: ProtectReason): string {
switch (reason.type) {
case ReasonType.Annotations:
return t("mergeDups.protectReason.annotations");
Expand Down Expand Up @@ -79,10 +76,7 @@ function senseReasonText(
}

/** Cases match Backend/Helper/LiftHelper.cs > GetProtectedReasons(LiftEntry entry) */
function wordReasonText(
t: TFunction<"translation", undefined>,
reason: ProtectReason
): string {
function wordReasonText(t: TFunction, reason: ProtectReason): string {
switch (reason.type) {
case ReasonType.Annotations:
return t("mergeDups.protectReason.annotations");
Expand Down

0 comments on commit f48e1eb

Please sign in to comment.