Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const { Transform } = require('stream');
- class AppendInitVect extends Transform {
- constructor(initVect, opts) {
- super(opts);
- this.initVect = initVect;
- this.appended = false;
- }
- _transform(chunk, encoding, cb) {
- if (!this.appended) {
- this.push(this.initVect);
- this.appended = true;
- }
- this.push(chunk);
- cb();
- }
- }
- module.exports = AppendInitVect;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement