Skip to content

Instantly share code, notes, and snippets.

@export-mike
Last active January 24, 2016 11:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save export-mike/322e6c340294113096b6 to your computer and use it in GitHub Desktop.
Save export-mike/322e6c340294113096b6 to your computer and use it in GitHub Desktop.
Problems with babel anonymous functions becoming named breaks couchdb.
// Before transpile
couchDesignDoc('User', {
email: {
map: (doc) => {
if(doc.type === 'User') {
emit(doc.email, doc);
}
}
}
});
//after transpile becomes broken in couchdb
couchDesignDoc('User', {
email: {
map: function map (doc) {
if(doc.type === 'User') {
emit(doc.email, doc);
}
}
}
});
// Before transpile
couchDesignDoc('User', {
email: {
map: function (doc) {
if(doc.type === 'User') {
emit(doc.email, doc);
}
}
}
});
//after transpile becomes broken in couchdb
couchDesignDoc('User', {
email: {
map: function map (doc) {
if(doc.type === 'User') {
emit(doc.email, doc);
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment