quietly

tcmts.cli.contributions.quietly · #hruco5tg · term · runs anywhere

Run fn without its console output: a merge made for a remote client reports through the result, not here.

export function quietly<T>(fn: () => T): T {
  const log = console.log;
  console.log = () => {};
  try {
    return fn();
  } finally {
    console.log = log;
  }
}

used by