Backend half

This commit is contained in:
2025-07-11 19:56:28 +02:00
parent fa868e7c1d
commit 8600fa7c1d
19426 changed files with 3750448 additions and 8108 deletions
@@ -0,0 +1,39 @@
var Transform = require('stream').Transform;
var parseEvent = require('./parse-event').parseEvent;
/** @type {Transform} */
function EventUnmarshallerStream(options) {
options = options || {};
// set output to object mode
options.readableObjectMode = true;
Transform.call(this, options);
this._readableState.objectMode = true;
this.parser = options.parser;
this.eventStreamModel = options.eventStreamModel;
}
EventUnmarshallerStream.prototype = Object.create(Transform.prototype);
/**
*
* @param {Buffer} chunk
* @param {string} encoding
* @param {*} callback
*/
EventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) {
try {
var event = parseEvent(this.parser, chunk, this.eventStreamModel);
this.push(event);
return callback();
} catch (err) {
callback(err);
}
};
/**
* @api private
*/
module.exports = {
EventUnmarshallerStream: EventUnmarshallerStream
};