On the author’s point of a “debug build” with runtime type checking, there is ts-runtime-checks [0], which looks to do something similar! I don’t have any experience with it however, just seen it looking at typescript-runtime-type-benchmarks [1]. There’s a few other similar things there too
Thanks for the pointer, I hadn't run across ts-runtime-checks before. It does do something similar to what I propose in the post. The difference is that ts-runtime-checks is opt-in. If you want a type validated at runtime, you have to write `Assert<T>`. What I'm proposing is that _all_ types be validated at runtime.
opt-in makes sense if you want these checks in production. The appeal of a "check everything" debug mode is that you wouldn't have to modify your TS at all to use it.
opt-in makes sense if you want these checks in production. The appeal of a "check everything" debug mode is that you wouldn't have to modify your TS at all to use it.