lib/template-manager.js
function compileTemplates(dir, type) {
    return getPaths(dir, ext, options).then(paths => {
      return options.Promise.all(paths.map(filePath => {
        return compileTemplate(dir, filePath, type);
      })).then(templates => {
        return templates.reduce((all, current) => {
          all[current._name] = current;
          return all;
        }, {});
      });
    });
  }
function compileTemplates(dir, type) {
    return getPaths(dir, ext, options).then(paths => {
      return options.Promise.all(paths.map(filePath => {
        return compileTemplate(dir, filePath, type);
      })).then(templates => {
        return templates.reduce((all, current) => {
          all[current._name] = current;
          return all;
        }, {});
      });
    });
  }
function compileTemplates ( dir , type ) { return getPaths ( dir , ext , options ) . then ( paths => { return options . Promise . all ( paths . map ( filePath => { return compileTemplate ( dir , filePath , type ) ; } ) ) . then ( templates => { return templates . reduce ( ( all , current ) => { all [ current . _name ] = current ; return all ; } , { } ) ; } ) ; } ) ; }
Compiles and caches all the templates in the specified directory, if it
exists. Returns a Promise for an object map of compiled Handlebars template
functions, mapped from the results of compileTemplate above.
@param  {String} dir  The directory to search in
@param  {String} type The type of templates these are
@return {Promise.<Object>}
@public
Compiles and caches all the templates in the specified directory if it exists . Returns a Promise for an object map of compiled Handlebars template functions mapped from the results of compileTemplate above .