From 529edccb49eec353f7df17ac44e15a44c38decb1 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov Date: Mon, 16 Oct 2023 13:41:36 +0300 Subject: [PATCH] refactor: use nullish coalescing (#5621) --- .../components/input-date-range/input-date-range.component.ts | 2 +- .../kit/components/input-date-time/input-date-time.component.ts | 2 +- projects/kit/components/input-date/input-date.component.ts | 2 +- projects/kit/components/input-number/input-number.component.ts | 2 +- projects/kit/components/input-time/input-time.component.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/kit/components/input-date-range/input-date-range.component.ts b/projects/kit/components/input-date-range/input-date-range.component.ts index 430a8df53548..29bcbff65390 100644 --- a/projects/kit/components/input-date-range/input-date-range.component.ts +++ b/projects/kit/components/input-date-range/input-date-range.component.ts @@ -250,7 +250,7 @@ export class TuiInputDateRangeComponent } get nativeValue(): string { - return this.nativeFocusableElement ? this.nativeFocusableElement.value : ''; + return this.nativeFocusableElement?.value || ''; } set nativeValue(value: string) { diff --git a/projects/kit/components/input-date-time/input-date-time.component.ts b/projects/kit/components/input-date-time/input-date-time.component.ts index 130b247c5725..810824f8a6e0 100644 --- a/projects/kit/components/input-date-time/input-date-time.component.ts +++ b/projects/kit/components/input-date-time/input-date-time.component.ts @@ -228,7 +228,7 @@ export class TuiInputDateTimeComponent } get nativeValue(): string { - return this.nativeFocusableElement ? this.nativeFocusableElement.value : ''; + return this.nativeFocusableElement?.value || ''; } set nativeValue(value: string) { diff --git a/projects/kit/components/input-date/input-date.component.ts b/projects/kit/components/input-date/input-date.component.ts index 3096ca4cfc9b..741e29933ced 100644 --- a/projects/kit/components/input-date/input-date.component.ts +++ b/projects/kit/components/input-date/input-date.component.ts @@ -192,7 +192,7 @@ export class TuiInputDateComponent } get nativeValue(): string { - return this.nativeFocusableElement ? this.nativeFocusableElement.value : ''; + return this.nativeFocusableElement?.value || ''; } set nativeValue(value: string) { diff --git a/projects/kit/components/input-number/input-number.component.ts b/projects/kit/components/input-number/input-number.component.ts index c0081c064e07..d185ee68627f 100644 --- a/projects/kit/components/input-number/input-number.component.ts +++ b/projects/kit/components/input-number/input-number.component.ts @@ -310,7 +310,7 @@ export class TuiInputNumberComponent } get nativeValue(): string { - return this.nativeFocusableElement ? this.nativeFocusableElement.value : ''; + return this.nativeFocusableElement?.value || ''; } set nativeValue(value: string) { diff --git a/projects/kit/components/input-time/input-time.component.ts b/projects/kit/components/input-time/input-time.component.ts index 29c5d1d2fbcc..0d741bfc5193 100644 --- a/projects/kit/components/input-time/input-time.component.ts +++ b/projects/kit/components/input-time/input-time.component.ts @@ -169,7 +169,7 @@ export class TuiInputTimeComponent } get nativeValue(): string { - return this.nativeFocusableElement ? this.nativeFocusableElement.value : ''; + return this.nativeFocusableElement?.value || ''; } set nativeValue(value: string) {