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

Function tryMap

lib/index.js:8184–8192  ·  view source on GitHub ↗
(db, fun, doc)

Source from the content-addressed store, hash-verified

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