tasks/catena.js
function streamMatches (grunt, fileData, options, matches, flattenedMatches) {
    // Run optional tasks after we stream  matches to dest.
    stream.createWriteStream(fileData.dest, () => {
        require('./dev/test')(grunt, fileData, options, throwAsyncError).performTests();

        if (options.deploy) {
            require('./deploy/parse')(grunt, fileData, options, asyncDone, throwAsyncError, flattenedMatches);
        } else {
            // Never end task if watch option is true and there are src directories to watch.
            if (options.watch && fileData.src.length > 0) {
                require('./dev/watch')(grunt, fileData, options, throwAsyncError, matches, flattenedMatches);
            } else {
                asyncDone(true);
            }
        }
    });

    // Place the flattened matches between the start wrapper and the end
    // wrapper into a single dimensional array.
    stream.pipeFileArray([fileData.tmpWrapStart, flattenedMatches, fileData.tmpWrapEnd].flat());
}
function streamMatches (grunt, fileData, options, matches, flattenedMatches) {
    // Run optional tasks after we stream  matches to dest.
    stream.createWriteStream(fileData.dest, () => {
        require('./dev/test')(grunt, fileData, options, throwAsyncError).performTests();

        if (options.deploy) {
            require('./deploy/parse')(grunt, fileData, options, asyncDone, throwAsyncError, flattenedMatches);
        } else {
            // Never end task if watch option is true and there are src directories to watch.
            if (options.watch && fileData.src.length > 0) {
                require('./dev/watch')(grunt, fileData, options, throwAsyncError, matches, flattenedMatches);
            } else {
                asyncDone(true);
            }
        }
    });

    // Place the flattened matches between the start wrapper and the end
    // wrapper into a single dimensional array.
    stream.pipeFileArray([fileData.tmpWrapStart, flattenedMatches, fileData.tmpWrapEnd].flat());
}
function streamMatches ( grunt , fileData , options , matches , flattenedMatches ) { // Run optional tasks after we stream  matches to dest. stream . createWriteStream ( fileData . dest , ( ) => { require ( './dev/test' ) ( grunt , fileData , options , throwAsyncError ) . performTests ( ) ; if ( options . deploy ) { require ( './deploy/parse' ) ( grunt , fileData , options , asyncDone , throwAsyncError , flattenedMatches ) ; } else { // Never end task if watch option is true and there are src directories to watch. if ( options . watch && fileData . src . length > 0 ) { require ( './dev/watch' ) ( grunt , fileData , options , throwAsyncError , matches , flattenedMatches ) ; } else { asyncDone ( true ) ; } } } ) ; // Place the flattened matches between the start wrapper and the end // wrapper into a single dimensional array. stream . pipeFileArray ( [ fileData . tmpWrapStart , flattenedMatches , fileData . tmpWrapEnd ] . flat ( ) ) ; }
Iterate all matches and stream them into the dest file.

@function streamMatches
@param {Object} grunt
@param {Object} fileData
@param {Object} options
@param {Array} matches
@param {Array} flattenedMatches
@api private
Iterate all matches and stream them into the dest file .