Created
May 14, 2015 20:14
-
-
Save kmaglione/428d325fc1de711ed0f7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postArgs: function(data) { | |
data.toString = function(format) { | |
return format.replace(/%([^%]+)%/g, function(_, key) { | |
return this.hasOwnProperty(key) ? this[key] : ''; | |
}.bind(this)); | |
} | |
var format = ""; | |
for (var key in data) { | |
if (key !== 'toString') { | |
format = format + key + "=%" + key + "%&"; | |
} | |
} | |
return data.toString(format); | |
}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment