Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
24 lines
454 B
Plaintext
24 lines
454 B
Plaintext
'use strict';
|
|
|
|
const stream = require('stream');
|
|
|
|
class BaseStream extends stream.Readable {
|
|
addEntry(/* entry, opts */) {
|
|
throw new Error('.addEntry not implemented in sub class!');
|
|
}
|
|
|
|
_read() {}
|
|
|
|
emit(event, data) {
|
|
if (event === 'error') {
|
|
const error = data;
|
|
if (error.name === 'Error') {
|
|
error.name = this.constructor.name + 'Error';
|
|
}
|
|
}
|
|
super.emit(event, data);
|
|
}
|
|
}
|
|
|
|
module.exports = BaseStream;
|