Skip to content

Commit

Permalink
refactor: use nullish coalescing (#5621)
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Oct 16, 2023
1 parent 5c41e09 commit 529edcc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class TuiInputDateRangeComponent
}

get nativeValue(): string {
return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';
return this.nativeFocusableElement?.value || '';
}

set nativeValue(value: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class TuiInputDateTimeComponent
}

get nativeValue(): string {
return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';
return this.nativeFocusableElement?.value || '';
}

set nativeValue(value: string) {
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 @@ -192,7 +192,7 @@ export class TuiInputDateComponent
}

get nativeValue(): string {
return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';
return this.nativeFocusableElement?.value || '';
}

set nativeValue(value: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ export class TuiInputNumberComponent
}

get nativeValue(): string {
return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';
return this.nativeFocusableElement?.value || '';
}

set nativeValue(value: string) {
Expand Down
2 changes: 1 addition & 1 deletion projects/kit/components/input-time/input-time.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export class TuiInputTimeComponent
}

get nativeValue(): string {
return this.nativeFocusableElement ? this.nativeFocusableElement.value : '';
return this.nativeFocusableElement?.value || '';
}

set nativeValue(value: string) {
Expand Down

0 comments on commit 529edcc

Please sign in to comment.