app/services/alphaVantage.js
/**
 * Creates a map between date and data from the response from AlphaVantage
 * @param {alphaVantageData} dailyData
 * @returns {map} dataMap
 */
Creates a map between date and data from the response from AlphaVantage
@param {alphaVantageData} dailyData
@returns {map} dataMap
Creates a map between date and data from the response from AlphaVantage @param { alphaVantageData } dailyData @returns { map } dataMap
function parseDailyData(dailyData) {
  var stockDataMap = {};
  for (var id in dailyData) {
    var dayData = dailyData[id];
    var date = dayData['Timestamp'];
    var dateString = JSON.stringify(date);
    dateString = dateString.slice(1,11);
    delete dayData['Timestamp'];
    stockDataMap[dateString] = dayData;
  }
  return stockDataMap;
}
function parseDailyData ( dailyData ) { var stockDataMap = { } ; for ( var id in dailyData ) { var dayData = dailyData [ id ] ; var date = dayData [ 'Timestamp' ] ; var dateString = JSON . stringify ( date ) ; dateString = dateString . slice ( 1 , 11 ) ; delete dayData [ 'Timestamp' ] ; stockDataMap [ dateString ] = dayData ; } return stockDataMap ; }
Creates a map between date and data from the response from AlphaVantage
 @param {alphaVantageData} dailyData
 @returns {map} dataMap
Creates a map between date and data from the response from AlphaVantage @param { alphaVantageData } dailyData @returns { map } dataMap