Closed

Description
Hi all,
I've tested the following code:
class TestPrivate {
public publicField: number;
private privateField: number;
constructor(pr: number, pub: number) {
this.privateField = pr;
this.publicField = pub;
}
}
const obj1 = new TestPrivate(123, 789);
const temp = { fakeWrapper: obj1 };
const { fakeWrapper: { privateField } } = temp;
console.log(privateField);
And I see in console 123 output. It seems that we have a violation of encapsulation here.