3 ms·
I was assuming the TypeScript/JavaScript scenario, where TypeScript objects are implemented as JavaScript objects and their structure is available at runtime. O
by yorwba 9y ago
I was assuming the TypeScript/JavaScript scenario, where TypeScript objects are implemented as JavaScript objects and their structure is available at runtime. Of course it does not work if you do not have that reflection capability.
- lilactown 9y agoYou can provide your own type guards: https://www.typescriptlang.org/docs/handbook/advanced-types.html https://www.typescriptlang.org/docs/handbook/advanced-types.... Doing this in the general case, I assume, is probably not practical.