pipe/plumber.js
function (content, type) {
        var results = [];

        if (content === undefined) {
            return results;
        }

        _.forEach(content, function (element) {
            if (element === undefined || element.type === undefined || element.type !== type) {
                return;
            }

            _.forEach(element.files, function (file) {
                var fragment = element[file];
                // filter collection of posts, these are commonly category fragments
                if (fragment === undefined || fragment.posts !== undefined) {
                    return;
                }

                results.push(fragment);
            });
        });

        return results;
    }
function (content, type) {
        var results = [];

        if (content === undefined) {
            return results;
        }

        _.forEach(content, function (element) {
            if (element === undefined || element.type === undefined || element.type !== type) {
                return;
            }

            _.forEach(element.files, function (file) {
                var fragment = element[file];
                // filter collection of posts, these are commonly category fragments
                if (fragment === undefined || fragment.posts !== undefined) {
                    return;
                }

                results.push(fragment);
            });
        });

        return results;
    }
function ( content , type ) { var results = [ ] ; if ( content === undefined ) { return results ; } _ . forEach ( content , function ( element ) { if ( element === undefined || element . type === undefined || element . type !== type ) { return ; } _ . forEach ( element . files , function ( file ) { var fragment = element [ file ] ; // filter collection of posts, these are commonly category fragments if ( fragment === undefined || fragment . posts !== undefined ) { return ; } results . push ( fragment ) ; } ) ; } ) ; return results ; }
Filters a given type of content files from the pipe
@param  {Object} content    Pipe content
@param  {String} type       Type of content to sort out (e.g. Pages, Posts or Statics)
@return {Array}             Object containing single content files from a given type
Filters a given type of content files from the pipe