Skip to content

Commit

Permalink
refactor: prefer nullish
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode committed Oct 9, 2024
1 parent 5343993 commit 1056309
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ItemWithBadge {
}

public valueOf(): number | null {
return this.badgeValue !== undefined ? this.badgeValue : null;
return this.badgeValue ?? null;
}
}

Expand Down
2 changes: 1 addition & 1 deletion projects/legacy/components/tag/tag.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export class TuiTagComponent {
}

protected get displayText(): string {
return this.editedText === null ? this.value : this.editedText;
return this.editedText ?? this.value;
}

protected get loaderSize(): TuiSizeXS {
Expand Down

0 comments on commit 1056309

Please sign in to comment.