lib/poet/methods.js
function addTemplate (poet, data) {
  if (!data.ext || !data.fn)
    throw new Error('Template must have both an extension and formatter function');

  [].concat(data.ext).map(function (ext) {
    poet.templates[ext] = data.fn;
  });

  return poet;
}
function addTemplate (poet, data) {
  if (!data.ext || !data.fn)
    throw new Error('Template must have both an extension and formatter function');

  [].concat(data.ext).map(function (ext) {
    poet.templates[ext] = data.fn;
  });

  return poet;
}
function addTemplate ( poet , data ) { if ( ! data . ext || ! data . fn ) throw new Error ( 'Template must have both an extension and formatter function' ) ; [ ] . concat ( data . ext ) . map ( function ( ext ) { poet . templates [ ext ] = data . fn ; } ) ; return poet ; }
Adds `data.fn` as a template formatter for all files with
extension `data.ext`, which may be a string or an array of strings.
Adds to `poet` instance templates.

@params {Poet} poet
@params {Object} data
@returns {Poet}
Adds data . fn as a template formatter for all files with extension data . ext which may be a string or an array of strings . Adds to poet instance templates .