From 527fb9ae6e2852df8dff1177de74aa56f97bf10a Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Mon, 18 Mar 2024 16:43:49 -0700 Subject: [PATCH] Make the code clearer `as` in TypeScript is not the same as in C#. --- src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 68abb10..f6c9cd6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1318,9 +1318,9 @@ export class ValidationService { * @returns */ private isDisabled(input: Element) { - // Test the the input is validatable and disabled - const validatableElement = input as ValidatableElement; - return validatableElement && validatableElement.disabled; + // If the input is validatable, we check the `disabled` property. + // Otherwise the `disabled` property is undefined and this returns false. + return (input as ValidatableElement).disabled; } /**