index.js
function (locals, viewTypes) {
    var names = viewTypes || this.viewTypes.partial;
    var opts = lazy.extend({}, this.options, locals);

    return names.reduce(function (acc, name) {
      var collection = this.views[name];

      lazy.forOwn(collection, function (view, key) {
        // handle `onMerge` middleware
        this.handleView('onMerge', view, locals);

        if (view.options.nomerge) return;
        if (opts.mergePartials !== false) {
          name = 'partials';
        }
        acc[name] = acc[name] || {};
        acc[name][key] = view.content;
      }, this);
      return acc;
    }.bind(this), {});
  }
function (locals, viewTypes) {
    var names = viewTypes || this.viewTypes.partial;
    var opts = lazy.extend({}, this.options, locals);

    return names.reduce(function (acc, name) {
      var collection = this.views[name];

      lazy.forOwn(collection, function (view, key) {
        // handle `onMerge` middleware
        this.handleView('onMerge', view, locals);

        if (view.options.nomerge) return;
        if (opts.mergePartials !== false) {
          name = 'partials';
        }
        acc[name] = acc[name] || {};
        acc[name][key] = view.content;
      }, this);
      return acc;
    }.bind(this), {});
  }
function ( locals , viewTypes ) { var names = viewTypes || this . viewTypes . partial ; var opts = lazy . extend ( { } , this . options , locals ) ; return names . reduce ( function ( acc , name ) { var collection = this . views [ name ] ; lazy . forOwn ( collection , function ( view , key ) { // handle `onMerge` middleware this . handleView ( 'onMerge' , view , locals ) ; if ( view . options . nomerge ) return ; if ( opts . mergePartials !== false ) { name = 'partials' ; } acc [ name ] = acc [ name ] || { } ; acc [ name ] [ key ] = view . content ; } , this ) ; return acc ; } . bind ( this ) , { } ) ; }
Merge "partials" view types. This is necessary for template
engines that only support one class of partials.

@name .mergePartials
@param {Object} `locals`
@param {Array} `viewTypes` Optionally pass an array of viewTypes to include.
@return {Object} Merged partials
Merge partials view types . This is necessary for template engines that only support one class of partials .