UNPKG

360 BJavaScriptView Raw
1'use strict';
2
3const { PassThrough } = require('stream');
4
5const { kellnerApp } = require('../symbols');
6
7module.exports = class KellnerPassThrough extends PassThrough {
8 constructor(app) {
9 super({ objectMode: true });
10 this[kellnerApp] = app;
11 this.on('error', e => this[kellnerApp].fail(e));
12 this.on('disconnect', e => this[kellnerApp].fail(e));
13 }
14};