develwoutacause’s avatardevelwoutacause’s Twitter Archive—№ 1,387

    1. …in reply to @simonhaenisch
      @simonhaenisch @wesbos That's interesting. The challenge there is that nothing is checking as 'video', you could cast to the wrong thing. In theory, a template type could work here in a type-checkable manner. querySelector('video.webcam' as const as video${string})
  1. …in reply to @develwoutacause
    @simonhaenisch @wesbos But querySelector() doesn't support that and it doesn't work with CSS combinators (div > video), so it's still pretty limited. Also 'foo' as const as 'bar' still passes type checking, which is surprising to me. I feel like it shouldn't? 🤔