@@ -41,7 +41,6 @@ for (const input of inputs) {
41
41
// Retrieve the attribute's value or throw.
42
42
const url: string = getAttribute (image, ' data-url' )
43
43
44
-
45
44
// Find the form's `input[name=login]` field or throw if not found.
46
45
const form: HTMLFormElement = query (document , ' form' , HTMLFormElement )
47
46
const input: HTMLInputElement = namedItem (form, ' login' )
@@ -91,20 +90,15 @@ if (el instanceof HTMLInputElement) {
91
90
92
91
Because ` document.querySelector ` is so frequently used in web applications,
93
92
and it's tedious to guard every element query with null checks, these tests
94
- are most often omitted.
95
-
96
- When using [ Flow] [ ] , however, these tests become required to pass the
97
- type checker.
93
+ are most often omitted. When using [ Flow] [ ] , however, these tests become
94
+ required to pass the type checker.
98
95
99
96
[ Flow ] : https://flow.org
100
97
101
98
The combination of null tests and subclass type refinements feels like we're
102
- working against the type system, rather than with it, which is the motivation
103
- for this library.
104
-
105
- These typed query functions consider a missing element, or an element of the
106
- wrong type, to be failed assertions and throw an exception to fail as early
107
- as possible.
99
+ working against the type system, rather than with it. So, typed query functions
100
+ consider a missing element, or an element of the wrong type, to be failed
101
+ assertions and throw an exception to fail as early as possible.
108
102
109
103
## Development
110
104
0 commit comments