Why Nostr? What is Njump?
2024-03-19 22:08:44
in reply to

Dusty Pomerleau on Nostr: npub1rqe57…cufvh Ah, this works! I was using `indexOf(document.activeElement)` to ...

Ah, this works! I was using `indexOf(document.activeElement)` to index into an array of HTMLElement, and suppressing the resulting error by typing the array as `Array<Element>`, but that resulted in a lot of casting back to `HTMLElement` later. Casting in the other direction is better, but honestly I don’t see why the compiler would allow it? If it’s possible for the returned item not to be an `HTMLElement`, how can tsc permit the cast?
Author Public Key
npub1t007tscc3gj0wmhaxajgjvxc4k37gkykr5pm9cxkyktdfamwgauqjg5tp0