3 ms·
Not sure about TS, but a good type system would not mean you know the structure of dynamic JSON. It would just guarantee that before accessing some field, you w
by k_bx 10y ago
Not sure about TS, but a good type system would not mean you know the structure of dynamic JSON. It would just guarantee that before accessing some field, you would define in some way your code path what to do in case there is that field and in case there isn't. So, at the end, even if you missed the structure, you would have a clearly-defined error reporting logic (or whatever is necessary) at your runtime.