tickethead-sdk
Version:
SDK for the Tickethead API
18 lines • 641 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.attachDebugProxy = attachDebugProxy;
/**
* Returns a proxy object which can be used in place of the regular object.
* This object will log all modifications of the target object's properties.
*/
function attachDebugProxy(target) {
const handler = {
set(obj, prop, value) {
console.log(`setting value of prop: ${String(prop)} to value: ${value} on obj: ${obj}`);
console.trace();
return (obj[prop] = value);
},
};
return new Proxy(target, handler);
}
//# sourceMappingURL=debug-proxy.js.map