The request method should allow functions in body to be able to save design docs correctly #24

Open
anton-107 opened this Issue Apr 20, 2011 · 0 comments

Projects

None yet

1 participant

Example request:
databaseClient.request("PUT", designName, designDoc, function(err, data) {} );

Design doc contains functions and they are cut off internally by JSON.stringify. Please, enhance this line:

body = JSON.stringify(body)

with this snippet:

body = JSON.stringify(body, function(key, val) {
  if (typeof val == 'function') {
    return val.toString();
  }
  return val;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment