0

I want to allow the class function to be nullable(In short support something like this):

class Example {
    a?: string;
    c?: string;
    b() {
        console.log(this.a);
    }
}

let c = (x: Example) {
    console.log('run');
}
c({a: "123"});

Background: I've added some presave hook for typeorm due to which most of the code has broken. I'd like to support it without breaking anything.

Play link

Black Mamba
  • 13,632
  • 6
  • 82
  • 105

0 Answers0