Chris Thoburn @runspired.com 路 Aug 14

So TIL about stripInternal, which is great except that it also turns out typescript adds a random #private member to classes that have JS private fields.... and this is used in type comparisons 馃槺

2 likes 3 replies

?

Replies

Erik 鉂わ笍 路 Aug 14

This is why we can鈥檛 have nice things.

Ashley Claymore 路 Aug 14

This is needed though. The methods of the class with private fields are unlikely to work with another object that only shares the public interface. I find it's best to write a separate interface that the class implements if want to have a "clean" API type that other objects can also implement.

Remco Haszing 路 Aug 14

Yep, I found out as well recently.