lib/pathTemplate.js
function (data) {
    return this.fields.reduce(function (output, field) {
      var replacement = ''
      var placeholder = field.placeholder
      var width = field.width

      if (field.prefix) {
        output += field.prefix
      }
      if (placeholder) {
        replacement = data[placeholder] || ''
        if (width && (placeholder === 'hash' || placeholder === 'chunkhash')) {
          replacement = replacement.slice(0, width)
        }
        output += replacement
      }

      return output
    }, '')
  }
function (data) {
    return this.fields.reduce(function (output, field) {
      var replacement = ''
      var placeholder = field.placeholder
      var width = field.width

      if (field.prefix) {
        output += field.prefix
      }
      if (placeholder) {
        replacement = data[placeholder] || ''
        if (width && (placeholder === 'hash' || placeholder === 'chunkhash')) {
          replacement = replacement.slice(0, width)
        }
        output += replacement
      }

      return output
    }, '')
  }
function ( data ) { return this . fields . reduce ( function ( output , field ) { var replacement = '' var placeholder = field . placeholder var width = field . width if ( field . prefix ) { output += field . prefix } if ( placeholder ) { replacement = data [ placeholder ] || '' if ( width && ( placeholder === 'hash' || placeholder === 'chunkhash' ) ) { replacement = replacement . slice ( 0 , width ) } output += replacement } return output } , '' ) }
Applies data to this template and outputs a filename.

@param Object data
Applies data to this template and outputs a filename .