object
structs?object
struct validates that a value matches a known object shape. Just like it's TypeScript counterpart, it does not allow unknown keys—this is very useful in catching bugs in the majority of cases.type
struct which is more generic, and acts similar to TypeScript's structural typing in that it does not care about any extra properties.json
struct?json
struct is that it needs to recursively iterate through deep objects to guarantee they're valid JSON. What's wrong with that? Nothing, except that it would be a footgun.json
utility yourself.