lib/Template.js
function Template(style, fields, opts) {
  // throw early if style is incorrect
  if (passFields.STYLES.indexOf(style) === -1) {
    throw new Error('Incorrect passbook style ' + style)
  }

  this.style  = style
  this.opts   = opts   || {}
  this.fields = fields || {}

  // Set formatVersion by default
  this.fields.formatVersion = 1
}
function Template(style, fields, opts) {
  // throw early if style is incorrect
  if (passFields.STYLES.indexOf(style) === -1) {
    throw new Error('Incorrect passbook style ' + style)
  }

  this.style  = style
  this.opts   = opts   || {}
  this.fields = fields || {}

  // Set formatVersion by default
  this.fields.formatVersion = 1
}
function Template ( style , fields , opts ) { // throw early if style is incorrect if ( passFields . STYLES . indexOf ( style ) === - 1 ) { throw new Error ( 'Incorrect passbook style ' + style ) } this . style = style this . opts = opts || { } this . fields = fields || { } // Set formatVersion by default this . fields . formatVersion = 1 }
Create a passbook template.
A Template acts as a pass without having all its fields set.

Internally, on createPass it merely passes its fields and the extra ones
provided as an argument to a new Pass object

@param {String} style  Pass style of the pass
@param {Object} fields Fields of the pass
@param {Object} opts   Extra options
Create a passbook template . A Template acts as a pass without having all its fields set .