MCPcopy Index your code
hub / github.com/apache/pouchdb / tryMap

Function tryMap

lib/index.es.js:8179–8187  ·  view source on GitHub ↗
(db, fun, doc)

Source from the content-addressed store, hash-verified

8177function createAbstractMapReduce(localDocName, mapper, reducer, ddocValidator) {
8178
8179 function tryMap(db, fun, doc) {
8180 // emit an event if there was an error thrown by a map function.
8181 // putting try/catches in a single function also avoids deoptimizations.
8182 try {
8183 fun(doc);
8184 } catch (e) {
8185 emitError(db, e, {fun, doc});
8186 }
8187 }
8188
8189 function tryReduce(db, fun, keys, values, rereduce) {
8190 // 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…