Skip to content

Commit

Permalink
refactor: use nullish coalescing (#5647)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Oct 16, 2023
1 parent 254e68b commit bb1a7ca
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class TuiPrimitiveTextfieldExample1 extends AbstractTuiControl<string> {
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get icon(): string {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class TuiPrimitiveTextfieldExample2 extends AbstractTuiControl<string> {
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

onFocused(focused: boolean): void {
Expand Down
2 changes: 1 addition & 1 deletion projects/kit/components/input-copy/input-copy.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class TuiInputCopyComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get icon(): TuiInputCopyOptions['icon'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class TuiInputDateRangeComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get computedMobile(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export class TuiInputDateTimeComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get calendarIcon(): TuiInputDateOptions['icon'] {
Expand Down
2 changes: 1 addition & 1 deletion projects/kit/components/input-date/input-date.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export class TuiInputDateComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get computedMobile(): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export class TuiInputMonthRangeComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get calendarIcon(): TuiInputDateOptions['icon'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class TuiInputMonthComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get calendarIcon(): TuiInputDateOptions['icon'] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class TuiInputPasswordComponent
}

get focused(): boolean {
return !!this.textfield && this.textfield.focused;
return !!this.textfield?.focused;
}

get icon(): PolymorpheusContent<TuiContextWithImplicit<TuiSizeL | TuiSizeS>> {
Expand Down

0 comments on commit bb1a7ca

Please sign in to comment.