Skip to content

Commit

Permalink
found that babel gives anonymous functions names which then get cast …
Browse files Browse the repository at this point in the history
…to a string with an identifier which breaks couchdb
  • Loading branch information
export-mike committed Jan 24, 2016
1 parent 7990156 commit 2fb5514
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/cradle.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ cradle.Connection.prototype.request = function (options, callback) {
if (options.body) {
options.body = JSON.stringify(options.body, function (k, val) {
if (typeof(val) === 'function') {
return val.toString();
return val.toString().replace(/function?\s[a-zA-Z]*/g, 'function ');
} else { return val }
});
options.headers["Content-Length"] = Buffer.byteLength(options.body);
Expand Down

0 comments on commit 2fb5514

Please sign in to comment.