export function proxifyFunction(fn) {
  const emitter = new AsyncEventEmitter();
  emitter.on('trap', logger.logTrap.bind(logger));

  return new Proxy(fn, new FunctionTrapHandler(emitter));