apache / nano

Nano is now part of Apache CouchDB. Repo moved to https://GitHub.com/apache/couchdb-nano

Home Page:https://github.com/apache/couchdb-nano

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

export-mike opened this issue · 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.

flatiron/cradle#306

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

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.

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