nano icon indicating copy to clipboard operation
nano copied to clipboard

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

Open export-mike opened this issue 8 years ago • 3 comments

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 avatar Jan 24 '16 12:01 export-mike

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

export-mike avatar May 17 '16 10:05 export-mike

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.

chrisfosterelli avatar May 18 '16 00:05 chrisfosterelli

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

carlosduclos avatar Mar 17 '17 13:03 carlosduclos