<commit_before>"use strict"

// TODO create a suite to route flow sequences

module.exports = function (scope, state, args = {}, data, stream, next) {

    /*{
        seqId: data.seqId (string)
        package: data.data (object)
        stream: data.stream (bool)
    }*/

    // call flow sequnce
    let options;
    if (typeof stream.pipe === "function") {
        options = {objectMode: args.objectMode || stream._readableState.objectMode};
    }

    const flow = scope.flow(args.seq || data.seq, args.data || data, options, next);
    flow.on('error', next);
    stream.done = next;
    if (flow.pipe) {
        stream = stream.pipe(flow);
    }
};<commit_msg>update to new flow version<commit_after>"use strict"

// TODO create a suite to route flow sequences

module.exports = function (event, state, args, next) {

    // call flow sequnce
    let options;
    if (typeof event.output.pipe === "function") {
        options = {objectMode: args.objectMode};// || stream._i._readableState.objectMode};
    }

    data.seq = args.seq || data.seq;
    next(null, data, event.output.pipe(scope.flow(data.seq, args.data || data, options)));
};
{'fraction_non_alphanumeric': 0.14721254355400698, 'fraction_numerical': 0.0, 'mean_word_length': 2.842809364548495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1293695', 'n_tokens_mistral': 356, 'n_tokens_neox': 348, 'n_words': 98}