We've recently been using the new-ish `defined` function instead of our previous `typeof` pattern.  It would be good to do that here, too, for consistency.