Skip to content

Instantly share code, notes, and snippets.

@e-jigsaw
Created January 20, 2015 11:07
Show Gist options
  • Save e-jigsaw/094a54c72abd6068968a to your computer and use it in GitHub Desktop.
Save e-jigsaw/094a54c72abd6068968a to your computer and use it in GitHub Desktop.
localBodyParser = (body)->
str = Object.keys(body)[0] + '=' + body[Object.keys(body)[0]]
str = str.split '\n\r'
res = {}
str.forEach (item)->
item = item.split '='
if item[0].length > 0 then res[item[0]] = item[1]
res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment