4 ms·
Surprised the `satisfies` operator wasn't called out
by metadaemon 11mo ago
Surprised the `satisfies` operator wasn't called out
- callumgare 11mo agoHow would that work? My understanding is that satisfies doesn’t change anythings type, it just provides an additional type validation check.
- Latty 11mo agoI believe satisfies will narrow the type const infers. It won't lose any information, so you can check it satisfies a broader type without stopping it being used as a narrower one, but it will narrow down the inference if given (but you can of course widen it back out with an explicit typing).
- seniorsassycat 11mo agoThat doesn't cast or change compile time type right?