Skip to content

Instantly share code, notes, and snippets.

@artcommacode
Created April 29, 2014 10:46
Show Gist options
  • Save artcommacode/11396631 to your computer and use it in GitHub Desktop.
Save artcommacode/11396631 to your computer and use it in GitHub Desktop.
for (var object in fields) {
req.body[object] = {};
for (var param in fields[object]) {
req.body[object][param] = Array.isArray(fields[object][param]) ? fields[object][param][0] : fields[object][param];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment