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

Function tryReduce

lib/index.es.js:8189–8200  ·  view source on GitHub ↗
(db, fun, keys, values, rereduce)

Source from the content-addressed store, hash-verified

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
8191 // functions to avoid extra memory allocations since the tryCode() case is used
8192 // for custom map functions (common) vs this function, which is only used for
8193 // custom reduce functions (rare)
8194 try {
8195 return {output : fun(keys, values, rereduce)};
8196 } catch (e) {
8197 emitError(db, e, {fun, keys, values, rereduce});
8198 return {error: e};
8199 }
8200 }
8201
8202 function sortByKeyThenValue(x, y) {
8203 const keyCompare = collate(x.key, y.key);

Callers 1

reduceViewFunction · 0.70

Calls 1

emitErrorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…