function load(module, mainMethod) {
  if (!mainMethod) {
    let ts = require(module);
    patch(ts);
    return ts;
  }

  Object.defineProperty(Object.prototype, mainMethod, {
    set(value) {
      patch(this);
      delete Object.prototype[mainMethod];
      this[mainMethod] = value;
    },
    configurable: true,
  });

  require(module);
}
/**
 * @param {string} module
 *        Path to original Typescript module to load and patch.
 * @param {string} [mainMethod]
 *        tsc.js runs the main method `executeCommandLine` before we have
 *        the chance to patch the `ts` object, so we need to intercept it.
 */
@param {string} module
Path to original Typescript module to load and patch.
@param {string} [mainMethod]
tsc.js runs the main method `executeCommandLine` before we have
the chance to patch the `ts` object, so we need to intercept it.
@param { string } module Path to original Typescript module to load and patch . @param { string } [ mainMethod ] tsc . js runs the main method ` executeCommandLine ` before we have the chance to patch the ` ts ` object so we need to intercept it .
function load(module, mainMethod) {
  if (!mainMethod) {
    let ts = require(module);
    patch(ts);
    return ts;
  }
  Object.defineProperty(Object.prototype, mainMethod, {
    set(value) {
      patch(this);
      delete Object.prototype[mainMethod];
      this[mainMethod] = value;
    },
    configurable: true,
  });
  require(module);
}
function load ( module , mainMethod ) { if ( ! mainMethod ) { let ts = require ( module ) ; patch ( ts ) ; return ts ; } Object . defineProperty ( Object . prototype , mainMethod , { set ( value ) { patch ( this ) ; delete Object . prototype [ mainMethod ] ; this [ mainMethod ] = value ; } , configurable : true , } ) ; require ( module ) ; }
@param {string} module
        Path to original Typescript module to load and patch.
@param { string } module Path to original Typescript module to load and patch .