Skip to content

Commit

Permalink
Remove useless ?; Prefer undefined to null
Browse files Browse the repository at this point in the history
  • Loading branch information
imnasnainaec committed Jan 30, 2025
1 parent 77aafaa commit 70a80a7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/goals/MergeDuplicates/MergeDupsTreeTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface MergeTreeWord {
flag: Flag;
note: Note;
protected: boolean;
protectReasons?: ProtectReason[] | null;
protectReasons?: ProtectReason[];
audioCount: number;
}

Expand Down Expand Up @@ -79,8 +79,8 @@ export function convertSenseToMergeTreeSense(
): MergeTreeSense {
return {
order,
protected: sense?.accessibility === Status.Protected,
protectReasons: sense?.protectReasons ?? undefined,
protected: sense.accessibility === Status.Protected,
protectReasons: sense.protectReasons ?? undefined,
srcWordId,
sense,
};
Expand All @@ -94,7 +94,7 @@ export function convertWordToMergeTreeWord(word: Word): MergeTreeWord {
mergeTreeWord.flag = { ...word.flag };
mergeTreeWord.note = { ...word.note };
mergeTreeWord.protected = word.accessibility === Status.Protected;
mergeTreeWord.protectReasons = word.protectReasons;
mergeTreeWord.protectReasons = word.protectReasons ?? undefined;
mergeTreeWord.audioCount = word.audio.length;
return mergeTreeWord;
}
Expand Down

0 comments on commit 70a80a7

Please sign in to comment.