index.js
function endStream(cb) {
        // If no files were passed in, no files go out ...
        if (!latestFile || (Object.keys(concats).length === 0 && concats.constructor === Object)) {
            cb();
            return;
        }

        // Prepare a method for pushing the stream
        const pushJoinedFile = (joinedBase) => {
            const joinedFile = new File({
                path: joinedBase,
                contents: concats[joinedBase].concat.content,
                stat: concats[joinedBase].stats
            });
            if (concats[joinedBase].concat.sourceMapping) {
                joinedFile.sourceMap = JSON.parse(concats[joinedBase].concat.sourceMap);
            }
            this.push(joinedFile);
            delete concats[joinedBase];
        };

        // Refine the dependency graph
        const refinedDependencyMap = [];
        dependencyGraph.forEach(edge => {
            if ((edge[0] in nameBaseMap) && (edge[1] in nameBaseMap)) {
                refinedDependencyMap.push([nameBaseMap[edge[0]], nameBaseMap[edge[1]]]);
            }
        });
        const sortedDependencies = refinedDependencyMap.length ? toposort(refinedDependencyMap).reverse() : [];
        sortedDependencies.map(pushJoinedFile);

        // Run through all registered contact instances
        for (const targetBase in concats) {
            pushJoinedFile(targetBase);
        }
        cb();
    }
function endStream(cb) {
        // If no files were passed in, no files go out ...
        if (!latestFile || (Object.keys(concats).length === 0 && concats.constructor === Object)) {
            cb();
            return;
        }

        // Prepare a method for pushing the stream
        const pushJoinedFile = (joinedBase) => {
            const joinedFile = new File({
                path: joinedBase,
                contents: concats[joinedBase].concat.content,
                stat: concats[joinedBase].stats
            });
            if (concats[joinedBase].concat.sourceMapping) {
                joinedFile.sourceMap = JSON.parse(concats[joinedBase].concat.sourceMap);
            }
            this.push(joinedFile);
            delete concats[joinedBase];
        };

        // Refine the dependency graph
        const refinedDependencyMap = [];
        dependencyGraph.forEach(edge => {
            if ((edge[0] in nameBaseMap) && (edge[1] in nameBaseMap)) {
                refinedDependencyMap.push([nameBaseMap[edge[0]], nameBaseMap[edge[1]]]);
            }
        });
        const sortedDependencies = refinedDependencyMap.length ? toposort(refinedDependencyMap).reverse() : [];
        sortedDependencies.map(pushJoinedFile);

        // Run through all registered contact instances
        for (const targetBase in concats) {
            pushJoinedFile(targetBase);
        }
        cb();
    }
function endStream ( cb ) { // If no files were passed in, no files go out ... if ( ! latestFile || ( Object . keys ( concats ) . length === 0 && concats . constructor === Object ) ) { cb ( ) ; return ; } // Prepare a method for pushing the stream const pushJoinedFile = ( joinedBase ) => { const joinedFile = new File ( { path : joinedBase , contents : concats [ joinedBase ] . concat . content , stat : concats [ joinedBase ] . stats } ) ; if ( concats [ joinedBase ] . concat . sourceMapping ) { joinedFile . sourceMap = JSON . parse ( concats [ joinedBase ] . concat . sourceMap ) ; } this . push ( joinedFile ) ; delete concats [ joinedBase ] ; } ; // Refine the dependency graph const refinedDependencyMap = [ ] ; dependencyGraph . forEach ( edge => { if ( ( edge [ 0 ] in nameBaseMap ) && ( edge [ 1 ] in nameBaseMap ) ) { refinedDependencyMap . push ( [ nameBaseMap [ edge [ 0 ] ] , nameBaseMap [ edge [ 1 ] ] ] ) ; } } ) ; const sortedDependencies = refinedDependencyMap . length ? toposort ( refinedDependencyMap ) . reverse ( ) : [ ] ; sortedDependencies . map ( pushJoinedFile ) ; // Run through all registered contact instances for ( const targetBase in concats ) { pushJoinedFile ( targetBase ) ; } cb ( ) ; }
End the stream

@param {Function} cb Callback
End the stream