code: function to_map(params) {
    var map = {};
  
    params.forEach(function (param, i) {
      param.index = i;
      map[param.name] = param;
    });
  
    map.length = params.length;
  
    return map;
  }
docs: Turn params array into a map for quick lookup.
  
  @param {Array} params
  @return {Object}
  @api private