Closed michalCapo closed 1 month ago
Hey @michalCapo 👋
For a feature request, please add some more information. For example, this could end up being a bit weird. Do structs have default values, why should a string default to ""
? I think theres some extra details that would need to be ironed out, but in general I support this idea.
Hi, we use superstruct for everything. We are creating database structure from schema, also we use struct schema for generation sql queries, generating object for our forms and afterwards validating input before schema is stored into db. To be honest i'm fine with structs defaults, this was only idea "stolen" from golang, to avoid null or undefined. So primitives should be defaulted to "" or 0 or false, but it's just an idea.
Thanks for the info! Do you mind bring this convo into the discussions area? As we work on pruning some of the issues, we've decided that feature requests should end up in the discussion board. Then we can go from there?
OK, what i need to do?
This should be as core functionality. Function make should create JS object with default values given by schema.