Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
I guess if you studying about this, it's cool way, but if you want use in your application i recommend use some library like zod (https://github.com/colinhacks/zod). There are some functionalities that make your work easily. But this is not a rule, just a suggestion.
I wouldn't reinvent the wheel: https://github.com/pelotom/runtypes
There's also libraries that will generate the parsing functions for you like io-ts or zod that could be interesting to look into