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

Function tryReduce

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

Source from the content-addressed store, hash-verified

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
8196 // functions to avoid extra memory allocations since the tryCode() case is used
8197 // for custom map functions (common) vs this function, which is only used for
8198 // custom reduce functions (rare)
8199 try {
8200 return {output : fun(keys, values, rereduce)};
8201 } catch (e) {
8202 emitError(db, e, {fun, keys, values, rereduce});
8203 return {error: e};
8204 }
8205 }
8206
8207 function sortByKeyThenValue(x, y) {
8208 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…