| ▲ | conartist6 2 days ago | |||||||
TS certainly thinks of external input as a boundary requiring safety, but usually that would mean form input or CLI args parsing or something. Usually there's little if any protection against a JS caller providing wrong-type args to TS functions. | ||||||||
| ▲ | md224 2 days ago | parent | next [-] | |||||||
Sure, but if the caller is Javascript then you're running Javascript, not Typescript*, so it makes sense that you're not going to get type safety. I'm also not sure we're actually disagreeing on anything, so perhaps my reply was pointless. I agree that if you mix JS and TS in the way you describe, you'll have problems. My reply was just to say "yes, and that's not really Typescript's fault", but perhaps you weren't implying that to begin with. * I'm aware that you can't run Typescript directly, but I hope my point here is clear... you're running a program that wasn't type-checked by TS. | ||||||||
| ||||||||
| ▲ | umanwizard 2 days ago | parent | prev [-] | |||||||
Something similar is true for most statically typed languages. If you write a C library, nothing stops someone from writing an assembly-language program that calls functions in your library with the wrong types. | ||||||||