Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(ChildBackend: Class) {
this.child = new ChildBackend(
this.messageListener.bind(this),
this.handleEnd.bind(this),
);
// Monitior all logging events inside this child process and forward to
// the main process via the bus.
this.loggerDisposable = Logger.onLog(event => {
bus.emit('logEvent', event);
});
}
constructor(opts: Opts) {
this.config = opts.config;
this.options = opts.options;
this.pluginOptions = new PluginOptions(this.options);
logger.onLog(event => this.report(event));
// Convert any internal bundles back to their public equivalents as reporting
// is public api
bus.on('reporterEvent', event => {
if (event.bundle == null) {
this.report(event);
} else {
this.report({
...event,
bundle: new NamedBundle(
event.bundle,
event.bundleGraph,
this.options,
),
});
}