I am working with an abstract class that looks like this
export abstract class Foo {
public f1() {
}
}
and I have two classes that extend the base class
export class Boo extends Foo {
}
export class Moo extends Foo {
}
Recently, I created a custom decorator as shown below
export function Bla() {
return (target: any, key: string, descriptor: PropertyDescriptor) => {
}
}
Incorporating the decorator into my initial class now looks like this
export abstract class Foo {
@Bla
public f1() {
}
}
I'm trying to figure out if there is a way in the decorator to distinguish where each call originated from, whether it was from Boo or Moo.
So far, I've attempted to check prototypes and constructors of target
, but I haven't been able to determine the source class. Is there a method to achieve this or am I approaching it incorrectly?
Any help would be greatly appreciated.