lib/common/schemas/dataSourceCache.js
function convertDSCacheToFieldOptions(fieldType, cacheEntries) {
  //Radio and Dropdown only allow the first option to be selected
  //Checkboxes can have multiple options selected.

  var alreadySelected = false;
  return _.map(cacheEntries, function(cacheEntry, index) {
    var valToReturn = {
      key: cacheEntry.key || index,
      label: cacheEntry.value,
      checked: cacheEntry.selected && (!alreadySelected || fieldType === CONSTANTS.FORM_CONSTANTS.FIELD_TYPE_CHECKBOXES)
    };
    if (valToReturn.checked) {
      alreadySelected = true;
    }
    return valToReturn;
  });
}
function convertDSCacheToFieldOptions(fieldType, cacheEntries) {
  //Radio and Dropdown only allow the first option to be selected
  //Checkboxes can have multiple options selected.

  var alreadySelected = false;
  return _.map(cacheEntries, function(cacheEntry, index) {
    var valToReturn = {
      key: cacheEntry.key || index,
      label: cacheEntry.value,
      checked: cacheEntry.selected && (!alreadySelected || fieldType === CONSTANTS.FORM_CONSTANTS.FIELD_TYPE_CHECKBOXES)
    };
    if (valToReturn.checked) {
      alreadySelected = true;
    }
    return valToReturn;
  });
}
function convertDSCacheToFieldOptions ( fieldType , cacheEntries ) { //Radio and Dropdown only allow the first option to be selected //Checkboxes can have multiple options selected. var alreadySelected = false ; return _ . map ( cacheEntries , function ( cacheEntry , index ) { var valToReturn = { key : cacheEntry . key || index , label : cacheEntry . value , checked : cacheEntry . selected && ( ! alreadySelected || fieldType === CONSTANTS . FORM_CONSTANTS . FIELD_TYPE_CHECKBOXES ) } ; if ( valToReturn . checked ) { alreadySelected = true ; } return valToReturn ; } ) ; }
Converting DS Cache Entries To Field Format
@param fieldType
@param cacheEntries
@returns {Array}
@private
Converting DS Cache Entries To Field Format