-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUtils.js
More file actions
21 lines (20 loc) · 801 Bytes
/
Utils.js
File metadata and controls
21 lines (20 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
exports.methodLog = function (str = "") {
return function (target, propertyKey, descriptor) {
// console.log(target.toString()); // will print all code of the class of target
// console.log(target.prototype); // will print "Interpreter {}"
// console.log(target.prototype.toString());
let method = descriptor.value;
descriptor.value = function () {
if (str.length > 0) {
console.log(str);
}
console.log(`method: ${getClassName(target)} ${propertyKey}`)
console.log({ args: arguments });
let result = method.apply(this, arguments);
if (result) {
console.log({ result: result });
}
return result;
}
}
};