apache / nano

Nano is now part of Apache CouchDB. Repo moved to https://GitHub.com/apache/couchdb-nano
https://github.com/apache/couchdb-nano
Other
1.13k stars 157 forks source link

anonymous functions transpiled with babel don't work with _design docs in couchdb #309

Open export-mike opened 8 years ago

export-mike commented 8 years ago

Hi I've been using nano and cradle and both libraries seem to have this problem,

possibly this change should be fixed in couchdb.

https://github.com/flatiron/cradle/pull/306

Have you encountered this issue before? How else could it be fixed?

export-mike commented 8 years ago

update from @janl https://github.com/flatiron/cradle/pull/306#issuecomment-213482586

chrisfosterelli commented 8 years ago

For what it's worth, we've dealt with that by doing this:

const validate = function(newDoc, savedDoc, userCtx) {
   // Content here
}.toString()

This results in validate being a stringified function that can be passed to Nano, and babel will not name it.

carlosduclos commented 7 years ago

This repository has been merged into apache/couchdb-nano, please continue the discussion here