MCPcopy Create free account
hub / github.com/apache/pouchdb / tryMap

Function tryMap

lib/index-browser.js:8146–8154  ·  view source on GitHub ↗
(db, fun, doc)

Source from the content-addressed store, hash-verified

8144function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {
8145
8146 function tryMap(db, fun, doc) {
8147 // emit an event if there was an error thrown by a map function.
8148 // putting try/catches in a single function also avoids deoptimizations.
8149 try {
8150 fun(doc);
8151 } catch (e) {
8152 emitError(db, e, {fun, doc});
8153 }
8154 }
8155
8156 function tryReduce(db, fun, keys, values, rereduce) {
8157 // same as above, but returning the result or an error. there are two separate

Callers 1

Calls 1

emitErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…