index.js 785 B

1234567891011121314151617181920212223242526272829303132
  1. "use strict";
  2. /**
  3. * Compatibility bridge to the new typescript code.
  4. *
  5. */
  6. const lib = require("./dist");
  7. module.exports = function() { return lib.makeOptionalRequire.apply(lib, arguments); }
  8. module.exports.tryRequire = lib.tryRequire;
  9. module.exports.tryResolve = lib.tryResolve;
  10. module.exports.try = lib.tryRequire;
  11. module.exports.resolve = lib.tryResolve;
  12. module.exports.makeOptionalRequire = lib.makeOptionalRequire;
  13. module.exports.optionalRequire = lib.optionalRequire;
  14. module.exports.optionalRequireCwd = lib.optionalRequireCwd;
  15. module.exports.optionalRequireTop = lib.optionalRequireTop;
  16. let __defaultLog;
  17. Object.defineProperty(module.exports, "log", {
  18. set(func) {
  19. __defaultLog = func;
  20. lib.setDefaultLog(func);
  21. },
  22. get() {
  23. return __defaultLog;
  24. },
  25. });