dynamicdata/index.js
function processStagingResp(resp, now, evergreen) {
  var keysToData = {};
  for (var key in resp) {
    [].forEach.call(resp[key], function(datedRow) {
      var start =  datedRow['start_date'] ? new Date(datedRow['start_date']) : null;
      var end = datedRow['end_date'] ? new Date(datedRow['end_date']) : null;
      if (evergreen) {
        var isEnabled = datetoggle.isEnabledNow(start, null, now);
      } else {
        var isEnabled = datetoggle.isEnabledNow(start, end, now);
      }
      if (isEnabled) {
        keysToData[key] = datedRow;
      }
    });
  }
  return keysToData;
}
function processStagingResp(resp, now, evergreen) {
  var keysToData = {};
  for (var key in resp) {
    [].forEach.call(resp[key], function(datedRow) {
      var start =  datedRow['start_date'] ? new Date(datedRow['start_date']) : null;
      var end = datedRow['end_date'] ? new Date(datedRow['end_date']) : null;
      if (evergreen) {
        var isEnabled = datetoggle.isEnabledNow(start, null, now);
      } else {
        var isEnabled = datetoggle.isEnabledNow(start, end, now);
      }
      if (isEnabled) {
        keysToData[key] = datedRow;
      }
    });
  }
  return keysToData;
}
function processStagingResp ( resp , now , evergreen ) { var keysToData = { } ; for ( var key in resp ) { [ ] . forEach . call ( resp [ key ] , function ( datedRow ) { var start = datedRow [ 'start_date' ] ? new Date ( datedRow [ 'start_date' ] ) : null ; var end = datedRow [ 'end_date' ] ? new Date ( datedRow [ 'end_date' ] ) : null ; if ( evergreen ) { var isEnabled = datetoggle . isEnabledNow ( start , null , now ) ; } else { var isEnabled = datetoggle . isEnabledNow ( start , end , now ) ; } if ( isEnabled ) { keysToData [ key ] = datedRow ; } } ) ; } return keysToData ; }
Normalizes staging data to become the same format as prod data.
Normalizes staging data to become the same format as prod data .