Skip to content

Commit

Permalink
Make the code clearer
Browse files Browse the repository at this point in the history
`as` in TypeScript is not the same as in C#.
  • Loading branch information
haacked committed Mar 18, 2024
1 parent 33728fd commit 527fb9a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down

0 comments on commit 527fb9a

Please sign in to comment.