gl-store-s3.js/node_modules/aws-sdk/lib/event-stream/buffered-create-event-strea...

22 lines
510 B
JavaScript
Raw Normal View History

2019-05-08 11:19:12 +00:00
var eventMessageChunker = require('../event-stream/event-message-chunker').eventMessageChunker;
var parseEvent = require('./parse-event').parseEvent;
function createEventStream(body, parser, model) {
var eventMessages = eventMessageChunker(body);
var events = [];
for (var i = 0; i < eventMessages.length; i++) {
events.push(parseEvent(parser, eventMessages[i], model));
}
return events;
}
/**
* @api private
*/
module.exports = {
createEventStream: createEventStream
};