Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
global.isTest = /test/g.test(process.env.NODE_ENV);
// define rootPath first, needed for requireF
global.rootPath = Path.resolve(Path.join(__dirname, '..', '..'));
const {
requireF,
} = require(Path.join(rootPath, 'core/services/CommonServices'));
global.requireF = requireF;
const I18nWrapper = requireF('core/services/I18nWrapper');
global.i18n = new I18nWrapper();
global.conf = Nconf;
global.eventEmitter = new EventEmitter();
global.pkg = require(Path.resolve(Path.join(rootPath, '..', 'package.json')));
constructor (options?: Options) {
const opts = options || {} as any
this.events = new EventEmitter()
this.log = wrapLogger(logger, logger)
this.app = opts.app
this.cache = opts.cache
this.router = opts.router || express.Router() // you can do this?
this.githubToken = opts.githubToken
this.throttleOptions = opts.throttleOptions
this.Octokit = opts.Octokit || ProbotOctokit
}