From db0a2a88fcc799d6ed20308b1849e0c96b61ba29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fu=20Abaris?= Date: Fri, 6 Dec 2024 12:30:16 +0100 Subject: [PATCH] fast-element: Simplify fromView condition in attributes Replace the ternary operator with a direct negation in the fromView method. This change enhances code readability and ensures consistent handling of null, undefined, false, and zero values. --- .../fast-element/src/components/attributes.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/web-components/fast-element/src/components/attributes.ts b/packages/web-components/fast-element/src/components/attributes.ts index 0177cb15ee5..1f3b51dd9c0 100644 --- a/packages/web-components/fast-element/src/components/attributes.ts +++ b/packages/web-components/fast-element/src/components/attributes.ts @@ -80,13 +80,13 @@ export const booleanConverter: ValueConverter = { }, fromView(value: any): any { - return value === null || + return !( + value === null || value === void 0 || value === "false" || value === false || value === 0 - ? false - : true; + ); }, };