3 ms·
Template literal types (a) have nothing to do with tagged template literals, and (b) are a game-changing feature, allowing you to write compile-time string pars
by AprilArcus 4y ago
Template literal types (a) have nothing to do with tagged template literals, and (b) are a game-changing feature, allowing you to write compile-time string parsers.
- Aeolun 4y ago> allowing you to write compile-time string parsers I’m not entirely sure this is a good thing. But it’s certainly convenient in some instances.
- rcfox 4y agoI, for one, love that my ORM can statically check my SQL statements.
- eyelidlessness 4y agoIt’s a cutesy thing that basically always comes with a “don’t actually do/use this!” disclaimer. The thing that’s actually good about template literal types is that they allow for modeling a whole class of real world JS that wasn’t possible otherwise. That is and always has been the fundamental goal of TS.