Skip to content

Instantly share code, notes, and snippets.

@vu3jej
Created February 15, 2015 19:47
Show Gist options
  • Save vu3jej/477293918a58fa94dc25 to your computer and use it in GitHub Desktop.
Save vu3jej/477293918a58fa94dc25 to your computer and use it in GitHub Desktop.
JS snippet to transform Kimonolabs JSON endpoints. Demo for http://jithe.sh/ post.
function transform(data) {
// Sort according to location
for(var collection in data.results) {
data.results[collection].sort(function(a, b) {
return a.location.localeCompare(b.location);
});
}
return data;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment