lib/util/geoLocationToCamelCase.js
function geoLocationToCamelCase (obj) {
  const 
    converted = {},
    keys = Object.keys(obj);
  let i; // NOSONAR

  for(i = 0; i < keys.length; i++) {
    const
      k = keys[i],
      idx = ['lat_lon', 'top_left', 'bottom_right'].indexOf(k);

    if (idx === -1) {
      converted[k] = obj[k];
    }
    else {
      converted[k
        .split('_')
        .map((v,j) => j === 0 ? v : v.charAt(0).toUpperCase() + v.substring(1))
        .join('')] = obj[k];
    }
  }

  return converted;
}
function geoLocationToCamelCase (obj) {
  const 
    converted = {},
    keys = Object.keys(obj);
  let i; // NOSONAR

  for(i = 0; i < keys.length; i++) {
    const
      k = keys[i],
      idx = ['lat_lon', 'top_left', 'bottom_right'].indexOf(k);

    if (idx === -1) {
      converted[k] = obj[k];
    }
    else {
      converted[k
        .split('_')
        .map((v,j) => j === 0 ? v : v.charAt(0).toUpperCase() + v.substring(1))
        .join('')] = obj[k];
    }
  }

  return converted;
}
function geoLocationToCamelCase ( obj ) { const converted = { } , keys = Object . keys ( obj ) ; let i ; // NOSONAR for ( i = 0 ; i < keys . length ; i ++ ) { const k = keys [ i ] , idx = [ 'lat_lon' , 'top_left' , 'bottom_right' ] . indexOf ( k ) ; if ( idx === - 1 ) { converted [ k ] = obj [ k ] ; } else { converted [ k . split ( '_' ) . map ( ( v , j ) => j === 0 ? v : v . charAt ( 0 ) . toUpperCase ( ) + v . substring ( 1 ) ) . join ( '' ) ] = obj [ k ] ; } } return converted ; }
Converts known geolocation fields from snake_case to camelCase
Other fields are copied without change

@param {object} obj - object containing geolocation fields
@returns {object} new object with converted fields
Converts known geolocation fields from snake_case to camelCase Other fields are copied without change