lib/geo.js
function findAddressComponent(components, type) {
  for (var i = 0; i < components.length; i++) {
    if (components[i].types.indexOf(type) > -1) {
      return components[i];
    }
  }

  return null;
}
function findAddressComponent(components, type) {
  for (var i = 0; i < components.length; i++) {
    if (components[i].types.indexOf(type) > -1) {
      return components[i];
    }
  }

  return null;
}
function findAddressComponent ( components , type ) { for ( var i = 0 ; i < components . length ; i ++ ) { if ( components [ i ] . types . indexOf ( type ) > - 1 ) { return components [ i ] ; } } return null ; }
Return the address component that matches the specified type
@param components an array of address components
@type specifies the component to return
@return the component or null if no components matched
Return the address component that matches the specified type