@putout/compare
Version:
compare AST-nodes according to 🦎 PutoutScript
21 lines (16 loc) • 489 B
JavaScript
;
const {createDebug} = require('obug');
module.exports.createDebug = (namespace) => {
const log = createDebug(namespace);
return new Proxy(log, {
apply(target, thisArg, args) {
global.__putout_debug?.(namespace, ...args);
return target(...args);
},
get(target, prop) {
if (global.__putout_debug?.[prop])
return true;
return target[prop];
},
});
};