Answer the question
In order to leave comments, you need to log in
Function data type?
What does "Function" mean after "target: " ? There seems to be no such data type in ts, and when using this decorator, an object is passed as the first argument, not a function.
function log(target: Function, key: string, value: any) {
return {
value: function (...args: any[]) {
var a = args.map(a => JSON.stringify(a)).join();
var result = value.value.apply(this, args);
var r = JSON.stringify(result);
console.log(`Call: ${key}(${a}) => ${r}`);
return result;
}
};
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question