From de412902f01207038209d90f8dc1896f4d4de044 Mon Sep 17 00:00:00 2001 From: David Graham Date: Fri, 14 Sep 2018 17:45:05 -0600 Subject: [PATCH] Tidy copy --- README.md | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 830cf91..f7a885f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,6 @@ for (const input of inputs) { // Retrieve the attribute's value or throw. const url: string = getAttribute(image, 'data-url') - // Find the form's `input[name=login]` field or throw if not found. const form: HTMLFormElement = query(document, 'form', HTMLFormElement) const input: HTMLInputElement = namedItem(form, 'login') @@ -91,20 +90,15 @@ if (el instanceof HTMLInputElement) { Because `document.querySelector` is so frequently used in web applications, and it's tedious to guard every element query with null checks, these tests -are most often omitted. - -When using [Flow][], however, these tests become required to pass the -type checker. +are most often omitted. When using [Flow][], however, these tests become +required to pass the type checker. [Flow]: https://flow.org The combination of null tests and subclass type refinements feels like we're -working against the type system, rather than with it, which is the motivation -for this library. - -These typed query functions consider a missing element, or an element of the -wrong type, to be failed assertions and throw an exception to fail as early -as possible. +working against the type system, rather than with it. So, typed query functions +consider a missing element, or an element of the wrong type, to be failed +assertions and throw an exception to fail as early as possible. ## Development