Skip to content

Instantly share code, notes, and snippets.

@bryanhelmig
Created February 22, 2013 10:24
Show Gist options
  • Save bryanhelmig/5012388 to your computer and use it in GitHub Desktop.
Save bryanhelmig/5012388 to your computer and use it in GitHub Desktop.
results = JSON.parse(bundle.response.content);
// assuming results is an array of objects, object being the full json you pasted
out = _.map(results, function(result){
// handle properties, ignoring versions
result.properties = _.object(_.map(result.properties, function(valueSet, key){
return [key, valueSet.value];
}));
// similar code to handle examples of {key: Array()}, maybe using _.first?
return result;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment