helpers/ddata.js
function indexChildren (options) {
  var context = _children.call(this, options)
  var fn = options.fn
  var inverse = options.inverse
  var i = 0
  var ret = ''
  var data

  var contextPath

  if (options.data) {
    data = handlebars.createFrame(options.data)
  }

  for (var j = context.length; i < j; i++) {
    indexDepthIncrement(options)
    if (data) {
      data.index = i
      data.first = (i === 0)
      data.last = (i === (context.length - 1))

      if (contextPath) {
        data.contextPath = contextPath + i
      }
    }
    ret = ret + fn(context[i], { data: data })
    indexDepthDecrement(options)
  }

  if (i === 0) {
    ret = inverse(this)
  }

  return ret
}
function indexChildren (options) {
  var context = _children.call(this, options)
  var fn = options.fn
  var inverse = options.inverse
  var i = 0
  var ret = ''
  var data

  var contextPath

  if (options.data) {
    data = handlebars.createFrame(options.data)
  }

  for (var j = context.length; i < j; i++) {
    indexDepthIncrement(options)
    if (data) {
      data.index = i
      data.first = (i === 0)
      data.last = (i === (context.length - 1))

      if (contextPath) {
        data.contextPath = contextPath + i
      }
    }
    ret = ret + fn(context[i], { data: data })
    indexDepthDecrement(options)
  }

  if (i === 0) {
    ret = inverse(this)
  }

  return ret
}
function indexChildren ( options ) { var context = _children . call ( this , options ) var fn = options . fn var inverse = options . inverse var i = 0 var ret = '' var data var contextPath if ( options . data ) { data = handlebars . createFrame ( options . data ) } for ( var j = context . length ; i < j ; i ++ ) { indexDepthIncrement ( options ) if ( data ) { data . index = i data . first = ( i === 0 ) data . last = ( i === ( context . length - 1 ) ) if ( contextPath ) { data . contextPath = contextPath + i } } ret = ret + fn ( context [ i ] , { data : data } ) indexDepthDecrement ( options ) } if ( i === 0 ) { ret = inverse ( this ) } return ret }
This helper is a duplicate of the handlebars `each` helper with the one exception that `indexDepthIncrement` is called on each iteration.
@static
@category Block helper: selector
This helper is a duplicate of the handlebars each helper with the one exception that indexDepthIncrement is called on each iteration .