3 ms·
Same. I have tried using it and enjoyed the IDE powers a bit more, but already knowing JS quite well, it wasn't a game changer. Lately I have started using Fas
by chrstphrhrt 6y ago
Same. I have tried using it and enjoyed the IDE powers a bit more, but already knowing JS quite well, it wasn't a game changer.
Lately I have started using FastAPI in Python, which uses Pydantic to enforce type hints at runtime. This saves a lot of manual checking code (e.g. "if input_data["mykey"] == "unhappy path": raise ValidationError").
This was the same annoyance in Node.js because the types are so flimsy and manually checking is really boring. Tests are great but if you can have correctness while rapidly prototyping that would seem to be a win.
Is there a great TS lib to do runtime type reflection like Pydantic?
- chrstphrhrt 6y agoSelf-reply: I found these two but haven't tried them. https://github.com/pelotom/runtypes https://github.com/pelotom/runtypes https://github.com/ianstormtaylor/superstruct https://github.com/ianstormtaylor/superstruct